Pular para o conteúdo principal

Class: Portkey

Hierarchy

  • BaseLLM

    Portkey

Constructors

constructor

new Portkey(init?): Portkey

Parameters

NameType
init?Partial<Portkey>

Returns

Portkey

Overrides

BaseLLM.constructor

Defined in

packages/core/src/llm/LLM.ts:293

Properties

apiKey

Optional apiKey: string = undefined

Defined in

packages/core/src/llm/LLM.ts:287


baseURL

Optional baseURL: string = undefined

Defined in

packages/core/src/llm/LLM.ts:288


llms

Optional llms: null | [LLMOptions] = undefined

Defined in

packages/core/src/llm/LLM.ts:290


mode

Optional mode: string = undefined

Defined in

packages/core/src/llm/LLM.ts:289


session

session: PortkeySession

Defined in

packages/core/src/llm/LLM.ts:291

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Overrides

BaseLLM.metadata

Defined in

packages/core/src/llm/LLM.ts:307

Methods

chat

chat(params): Promise<AsyncIterable<{ delta: string ; options?: Record<string, unknown> }>>

Parameters

NameType
paramsLLMChatParamsStreaming<Record<string, unknown>>

Returns

Promise<AsyncIterable<{ delta: string ; options?: Record<string, unknown> }>>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:311

chat(params): Promise<ChatResponse<Record<string, unknown>>>

Parameters

NameType
paramsLLMChatParamsNonStreaming<Record<string, unknown>>

Returns

Promise<ChatResponse<Record<string, unknown>>>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:314


complete

complete(params): Promise<AsyncIterable<CompletionResponse>>

Parameters

NameType
paramsLLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse>>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:27

complete(params): Promise<CompletionResponse>

Parameters

NameType
paramsLLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:30


streamChat

streamChat(messages, params?): AsyncIterable<{ delta: string ; options?: Record<string, unknown> }>

Parameters

NameType
messages{ content: MessageContent ; options?: Record<string, unknown> ; role: MessageType }[]
params?Record<string, any>

Returns

AsyncIterable<{ delta: string ; options?: Record<string, unknown> }>

Defined in

packages/core/src/llm/LLM.ts:338