Class: Portkey
Unified language model interface
Extends
Constructors
new Portkey()
new Portkey(
init
?):Portkey
Parameters
• init?: Partial
<Portkey
> & ApiClientInterface
Returns
Overrides
Defined in
packages/providers/portkey-ai/dist/index.d.ts:20
Properties
apiKey?
optional
apiKey:string
Defined in
packages/providers/portkey-ai/dist/index.d.ts:17
baseURL?
optional
baseURL:string
Defined in
packages/providers/portkey-ai/dist/index.d.ts:18
session
session:
PortkeySession
Defined in
packages/providers/portkey-ai/dist/index.d.ts:19
Accessors
metadata
Get Signature
get metadata():
LLMMetadata
Returns
Overrides
Defined in
packages/providers/portkey-ai/dist/index.d.ts:21
Methods
chat()
chat(params)
chat(
params
):Promise
<AsyncIterable
<ChatResponseChunk
,any
,any
>>
Get a chat response from the LLM
Parameters
• params: LLMChatParamsStreaming
<object
, object
>
Returns
Promise
<AsyncIterable
<ChatResponseChunk
, any
, any
>>
Overrides
Defined in
packages/providers/portkey-ai/dist/index.d.ts:22
chat(params)
chat(
params
):Promise
<ChatResponse
<object
>>
Parameters
• params: LLMChatParamsNonStreaming
<object
, object
>
Returns
Promise
<ChatResponse
<object
>>
Overrides
Defined in
packages/providers/portkey-ai/dist/index.d.ts:23
complete()
complete(params)
complete(
params
):Promise
<AsyncIterable
<CompletionResponse
,any
,any
>>
Get a prompt completion from the LLM
Parameters
• params: LLMCompletionParamsStreaming
Returns
Promise
<AsyncIterable
<CompletionResponse
, any
, any
>>
Inherited from
Defined in
packages/core/llms/dist/index.d.ts:163
complete(params)
complete(
params
):Promise
<CompletionResponse
>
Parameters
• params: LLMCompletionParamsNonStreaming
Returns
Promise
<CompletionResponse
>
Inherited from
Defined in
packages/core/llms/dist/index.d.ts:164
streamChat()
streamChat(
messages
,params
?):AsyncIterable
<ChatResponseChunk
,any
,any
>
Parameters
• messages: ChatMessage
[]
• params?: object
Returns
AsyncIterable
<ChatResponseChunk
, any
, any
>
Defined in
packages/providers/portkey-ai/dist/index.d.ts:24