Pular para o conteúdo principal

Class: Portkey

Hierarchy

  • BaseLLM

    Portkey

Constructors

constructor

new Portkey(init?)

Parameters

NameType
init?Partial<Portkey>

Overrides

BaseLLM.constructor

Defined in

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

Properties

apiKey

Optional apiKey: string = undefined

Defined in

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


baseURL

Optional baseURL: string = undefined

Defined in

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


callbackManager

Optional callbackManager: CallbackManager

Defined in

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


llms

Optional llms: null | [LLMOptions] = undefined

Defined in

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


mode

Optional mode: string = undefined

Defined in

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


session

session: PortkeySession

Defined in

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

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Overrides

BaseLLM.metadata

Defined in

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

Methods

chat

chat(params): Promise<AsyncIterable<ChatResponseChunk>>

Parameters

NameType
paramsLLMChatParamsStreaming

Returns

Promise<AsyncIterable<ChatResponseChunk>>

Overrides

BaseLLM.chat

Defined in

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

chat(params): Promise<ChatResponse>

Parameters

NameType
paramsLLMChatParamsNonStreaming

Returns

Promise<ChatResponse>

Overrides

BaseLLM.chat

Defined in

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


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:18

complete(params): Promise<CompletionResponse>

Parameters

NameType
paramsLLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

BaseLLM.complete

Defined in

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


streamChat

streamChat(messages, parentEvent?, params?): AsyncIterable<ChatResponseChunk>

Parameters

NameType
messagesChatMessage[]
parentEvent?Event
params?Record<string, any>

Returns

AsyncIterable<ChatResponseChunk>

Defined in

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


tokens

tokens(messages): number

Parameters

NameType
messagesChatMessage[]

Returns

number

Overrides

BaseLLM.tokens

Defined in

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