Class: OpenAI
Hierarchy
-
ToolCallLLM
<OpenAIAdditionalChatOptions
>↳
OpenAI
↳↳
FireworksLLM
↳↳
Groq
↳↳
TogetherLLM
Constructors
constructor
• new OpenAI(init?
): OpenAI
Parameters
Name | Type |
---|---|
init? | Partial <OpenAI > & { azure? : AzureOpenAIConfig } |
Returns
Overrides
ToolCallLLM<OpenAIAdditionalChatOptions>.constructor
Defined in
packages/core/src/llm/open_ai.ts:179
Properties
additionalChatOptions
• Optional
additionalChatOptions: OpenAIAdditionalChatOptions
Defined in
packages/core/src/llm/open_ai.ts:167
additionalSessionOptions
• Optional
additionalSessionOptions: Omit
<Partial
<ClientOptions
>, "apiKey"
| "maxRetries"
| "timeout"
>
Defined in
packages/core/src/llm/open_ai.ts:174
apiKey
• Optional
apiKey: string
= undefined
Defined in
packages/core/src/llm/open_ai.ts:170
maxRetries
• maxRetries: number
Defined in
packages/core/src/llm/open_ai.ts:171
maxTokens
• Optional
maxTokens: number
Defined in
packages/core/src/llm/open_ai.ts:166
model
• model: string
Defined in
packages/core/src/llm/open_ai.ts:163
session
• session: OpenAISession
Defined in
packages/core/src/llm/open_ai.ts:173
temperature
• temperature: number
Defined in
packages/core/src/llm/open_ai.ts:164
timeout
• Optional
timeout: number
Defined in
packages/core/src/llm/open_ai.ts:172
topP
• topP: number
Defined in
packages/core/src/llm/open_ai.ts:165
Accessors
metadata
• get
metadata(): LLMMetadata
Returns
Overrides
ToolCallLLM.metadata
Defined in
packages/core/src/llm/open_ai.ts:236
supportToolCall
• get
supportToolCall(): boolean
Returns
boolean
Overrides
ToolCallLLM.supportToolCall
Defined in
packages/core/src/llm/open_ai.ts:232
Methods
chat
▸ chat(params
): Promise
<AsyncIterable
<ChatResponseChunk
<ToolCallLLMMessageOptions
>>>
Parameters
Name | Type |
---|---|
params | LLMChatParamsStreaming <OpenAIAdditionalChatOptions , ToolCallLLMMessageOptions > |
Returns
Promise
<AsyncIterable
<ChatResponseChunk
<ToolCallLLMMessageOptions
>>>
Overrides
ToolCallLLM.chat
Defined in
packages/core/src/llm/open_ai.ts:313
▸ chat(params
): Promise
<ChatResponse
<ToolCallLLMMessageOptions
>>
Parameters
Name | Type |
---|---|
params | LLMChatParamsNonStreaming <OpenAIAdditionalChatOptions , ToolCallLLMMessageOptions > |
Returns
Promise
<ChatResponse
<ToolCallLLMMessageOptions
>>
Overrides
ToolCallLLM.chat
Defined in
packages/core/src/llm/open_ai.ts:319
complete
▸ complete(params
): Promise
<AsyncIterable
<CompletionResponse
>>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsStreaming |
Returns
Promise
<AsyncIterable
<CompletionResponse
>>
Inherited from
ToolCallLLM.complete
Defined in
packages/core/src/llm/base.ts:22
▸ complete(params
): Promise
<CompletionResponse
>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsNonStreaming |
Returns
Promise
<CompletionResponse
>
Inherited from
ToolCallLLM.complete
Defined in
packages/core/src/llm/base.ts:25
streamChat
▸ streamChat(baseRequestParams
): AsyncIterable
<ChatResponseChunk
<ToolCallLLMMessageOptions
>>
Parameters
Name | Type |
---|---|
baseRequestParams | ChatCompletionCreateParams |
Returns
AsyncIterable
<ChatResponseChunk
<ToolCallLLMMessageOptions
>>
Defined in
packages/core/src/llm/open_ai.ts:385
toOpenAIMessage
▸ toOpenAIMessage(messages
): ChatCompletionMessageParam
[]
Parameters
Name | Type |
---|---|
messages | ChatMessage <ToolCallLLMMessageOptions >[] |
Returns
ChatCompletionMessageParam
[]
Defined in
packages/core/src/llm/open_ai.ts:264
toOpenAIRole
▸ toOpenAIRole(messageType
): ChatCompletionRole
Parameters
Name | Type |
---|---|
messageType | MessageType |