Skip to main content

Class: Portkey

Unified language model interface

Extends

Constructors

new Portkey()

new Portkey(init?): Portkey

Parameters

init?: Partial <Portkey>

Returns

Portkey

Overrides

BaseLLM . constructor

Source

packages/llamaindex/src/llm/portkey.ts:76

Properties

apiKey?

optional apiKey: string = undefined

Source

packages/llamaindex/src/llm/portkey.ts:70


baseURL?

optional baseURL: string = undefined

Source

packages/llamaindex/src/llm/portkey.ts:71


llms?

optional llms: null | [LLMOptions] = undefined

Source

packages/llamaindex/src/llm/portkey.ts:73


mode?

optional mode: string = undefined

Source

packages/llamaindex/src/llm/portkey.ts:72


session

session: PortkeySession

Source

packages/llamaindex/src/llm/portkey.ts:74

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Source

packages/llamaindex/src/llm/portkey.ts:90

Methods

chat()

chat(params)

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

Get a chat response from the LLM

Parameters

params: LLMChatParamsStreaming<object, object>

Returns

Promise<AsyncIterable <ChatResponseChunk>>

Overrides

BaseLLM . chat

Source

packages/llamaindex/src/llm/portkey.ts:94

chat(params)

chat(params): Promise <ChatResponse<object>>

Parameters

params: LLMChatParamsNonStreaming<object, object>

Returns

Promise <ChatResponse<object>>

Overrides

BaseLLM . chat

Source

packages/llamaindex/src/llm/portkey.ts:97


complete()

complete(params)

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

Get a prompt completion from the LLM

Parameters

params: LLMCompletionParamsStreaming

Returns

Promise<AsyncIterable <CompletionResponse>>

Inherited from

BaseLLM . complete

Source

packages/core/dist/llms/index.d.ts:168

complete(params)

complete(params): Promise <CompletionResponse>

Parameters

params: LLMCompletionParamsNonStreaming

Returns

Promise <CompletionResponse>

Inherited from

BaseLLM . complete

Source

packages/core/dist/llms/index.d.ts:169


streamChat()

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

Parameters

messages: ChatMessage[]

params?: Record<string, any>

Returns

AsyncIterable <ChatResponseChunk>

Source

packages/llamaindex/src/llm/portkey.ts:121