BaseOpenAIModelOptions interface
Base model options common to both OpenAI and Azure OpenAI services.
Properties
client |
Optional. Custom client options to use when calling the OpenAI API. |
log |
Optional. Whether to log requests to the console. |
max |
Optional. Maximum number of retries to use when calling the OpenAI API. |
request |
|
response |
Optional. Forces the model return a specific response format. |
retry |
|
seed | Optional. A static seed to use when making model calls. |
stream | Optional. Whether the models responses should be streamed back using Server Sent Events (SSE.) |
use |
Optional. Whether to use |
Property Details
clientOptions
Optional. Custom client options to use when calling the OpenAI API.
clientOptions?: ClientOptions
Property Value
ClientOptions
logRequests
Optional. Whether to log requests to the console.
logRequests?: boolean
Property Value
boolean
Remarks
This is useful for debugging prompts and defaults to false
.
maxRetries
Optional. Maximum number of retries to use when calling the OpenAI API.
maxRetries?: number
Property Value
number
Remarks
The default is to retry twice.
requestConfig
Warning
This API is now deprecated.
Optional. Request options to use when calling the OpenAI API.
requestConfig?: AxiosRequestConfig<any>
Property Value
AxiosRequestConfig<any>
responseFormat
Optional. Forces the model return a specific response format.
responseFormat?: { type: "json_object" }
Property Value
{ type: "json_object" }
Remarks
This can be used to force the model to always return a valid JSON object.
retryPolicy
Warning
This API is now deprecated.
Optional. Retry policy to use when calling the OpenAI API.
retryPolicy?: number[]
Property Value
number[]
Remarks
Use maxRetries
instead.
seed
Optional. A static seed to use when making model calls.
seed?: number
Property Value
number
Remarks
The default is to use a random seed. Specifying a seed will make the model deterministic.
stream
Optional. Whether the models responses should be streamed back using Server Sent Events (SSE.)
stream?: boolean
Property Value
boolean
Remarks
Defaults to false
.
useSystemMessages
Optional. Whether to use system
messages when calling the OpenAI API.
useSystemMessages?: boolean
Property Value
boolean
Remarks
The current generation of models tend to follow instructions from user
messages better
then system
messages so the default is false
, which causes any system
message in the
prompt to be sent as user
messages instead.