Class: OpenAI
OpenAI LLM implementation
Hierarchy
-
BaseLLM
↳
OpenAI
↳↳
FireworksLLM
↳↳
Groq
↳↳
TogetherLLM
Constructors
constructor
• new OpenAI(init?
): OpenAI
Parameters
Name | Type |
---|---|
init? | Partial <OpenAI > & { azure? : AzureOpenAIConfig } |
Returns
Overrides
BaseLLM.constructor
Defined in
packages/core/src/llm/LLM.ts:103
Properties
additionalChatOptions
• Optional
additionalChatOptions: Omit
<Partial
<ChatCompletionCreateParams
>, "messages"
| "stream"
| "max_tokens"
| "model"
| "temperature"
| "top_p"
| "tools"
| "toolChoice"
>
Defined in
packages/core/src/llm/LLM.ts:81
additionalSessionOptions
• Optional
additionalSessionOptions: Omit
<Partial
<ClientOptions
>, "apiKey"
| "timeout"
| "maxRetries"
>
Defined in
packages/core/src/llm/LLM.ts:98
apiKey
• Optional
apiKey: string
= undefined
Defined in
packages/core/src/llm/LLM.ts:94
maxRetries
• maxRetries: number
Defined in
packages/core/src/llm/LLM.ts:95
maxTokens
• Optional
maxTokens: number
Defined in
packages/core/src/llm/LLM.ts:80
model
• model: string
Defined in
packages/core/src/llm/LLM.ts:77
session
• session: OpenAISession
Defined in
packages/core/src/llm/LLM.ts:97
temperature
• temperature: number
Defined in
packages/core/src/llm/LLM.ts:78
timeout
• Optional
timeout: number
Defined in
packages/core/src/llm/LLM.ts:96
topP
• topP: number
Defined in
packages/core/src/llm/LLM.ts:79
Accessors
metadata
• get
metadata(): Object
Returns
Object
Name | Type |
---|---|
contextWindow | number |
isFunctionCallingModel | boolean |
maxTokens | undefined | number |
model | string |
temperature | number |
tokenizer | CL100K_BASE |
topP | number |
Overrides
BaseLLM.metadata
Defined in
packages/core/src/llm/LLM.ts:156
Methods
chat
▸ chat(params
): Promise
<AsyncIterable
<ChatResponseChunk
>>