Class: Portkey
Hierarchy
-
BaseLLM
↳
Portkey
Constructors
constructor
• new Portkey(init?
): Portkey
Parameters
Name | Type |
---|---|
init? | Partial <Portkey > |
Returns
Overrides
BaseLLM.constructor
Defined in
packages/core/src/llm/LLM.ts:712
Properties
apiKey
• Optional
apiKey: string
= undefined
Defined in
packages/core/src/llm/LLM.ts:705
baseURL
• Optional
baseURL: string
= undefined
Defined in
packages/core/src/llm/LLM.ts:706
callbackManager
• Optional
callbackManager: CallbackManager
Defined in
packages/core/src/llm/LLM.ts:710
llms
• Optional
llms: null
| [LLMOptions
] = undefined
Defined in
packages/core/src/llm/LLM.ts:708
mode
• Optional
mode: string
= undefined
Defined in
packages/core/src/llm/LLM.ts:707
session
• session: PortkeySession
Defined in
packages/core/src/llm/LLM.ts:709
Accessors
metadata
• get
metadata(): LLMMetadata
Returns
Overrides
BaseLLM.metadata
Defined in
packages/core/src/llm/LLM.ts:731
Methods
chat
▸ chat(params
): Promise
<AsyncIterable
<ChatResponseChunk
>>
Parameters
Name | Type |
---|---|
params | LLMChatParamsStreaming |
Returns
Promise
<AsyncIterable
<ChatResponseChunk
>>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/LLM.ts:735
▸ chat(params
): Promise
<ChatResponse
>
Parameters
Name | Type |
---|---|
params | LLMChatParamsNonStreaming |
Returns
Promise
<ChatResponse
>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/LLM.ts:738
complete
▸ complete(params
): Promise
<AsyncIterable
<CompletionResponse
>>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsStreaming |
Returns
Promise
<AsyncIterable
<CompletionResponse
>>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:18
▸ complete(params
): Promise
<CompletionResponse
>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsNonStreaming |
Returns
Promise
<CompletionResponse
>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:21
streamChat
▸ streamChat(messages
, parentEvent?
, params?
): AsyncIterable
<ChatResponseChunk
>
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
parentEvent? | Event |
params? | Record <string , any > |
Returns
AsyncIterable
<ChatResponseChunk
>
Defined in
packages/core/src/llm/LLM.ts:758
tokens
▸ tokens(messages
): number
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
number
Overrides
BaseLLM.tokens