Optional
audio?: undefined | ChatCompletionAudioParamOptional
callbacks?: undefined | CallbacksCallbacks for this call and any sub-calls (eg. a Chain calling an LLM). Tags are passed to all callbacks, metadata is passed to handle*Start callbacks.
Optional
function_Optional
functions?: undefined | FunctionDefinition[]Optional
ls_Describes the format of structured outputs. This should be provided if an output is considered to be structured
Optional
maxMaximum number of parallel calls to make.
Optional
metadata?: undefined | Record<string, unknown>Metadata for this call and any sub-calls (eg. a Chain calling an LLM). Keys should be strings, values should be JSON-serializable.
Optional
modalities?: undefined | ChatCompletionModality[]Output types that you would like the model to generate for this request. Most models are capable of generating text, which is the default:
["text"]
The gpt-4o-audio-preview
model can also be used to
generate audio. To request that
this model generate both text and audio responses, you can use:
["text", "audio"]
Optional
options?: undefined | RequestOptionsAdditional options to pass to the underlying axios request.
Optional
parallel_The model may choose to call multiple functions in a single turn. You can set parallel_tool_calls to false which ensures only one tool is called at most. Learn more
Optional
prediction?: undefined | ChatCompletionPredictionContentStatic predicted output content, such as the content of a text file that is being regenerated. Learn more.
Optional
promptUsed by OpenAI to cache responses for similar requests to optimize your cache
hit rates. Replaces the user
field.
Learn more.
Optional
promptAdds a prompt index to prompts passed to the model to track what prompt is being used for a given generation.
Optional
reasoning?: undefined | ReasoningOptions for reasoning models.
Note that some options, like reasoning summaries, are only available when using the responses API. If these options are set, the responses API will be used to fulfill the request.
These options will be ignored when not using a reasoning model.
Optional
recursionMaximum number of times a call can recurse. If not provided, defaults to 25.
Optional
response_An object specifying the format that the model must output.
Optional
runUnique identifier for the tracer run for this call. If not provided, a new UUID will be generated.
Optional
runName for the tracer run for this call. Defaults to the name of the class.
Optional
seed?: undefined | numberWhen provided, the completions API will make a best effort to sample
deterministically, such that repeated requests with the same seed
and parameters should return the same result.
Optional
signal?: undefined | AbortSignalAbort signal for this call. If provided, the call will be aborted when the signal is aborted.
Optional
stop?: undefined | string[]Stop tokens to use for this call. If not provided, the default stop tokens for the model will be used.
Optional
stream_Additional options to pass to streamed completions. If provided, this takes precedence over "streamUsage" set at initialization time.
Optional
strict?: undefined | booleanIf true
, model output is guaranteed to exactly match the JSON Schema
provided in the tool definition. If true
, the input schema will also be
validated according to
https://platform.openai.com/docs/guides/structured-outputs/supported-schemas.
If false
, input schema will not be validated and model output will not
be validated.
If undefined
, strict
argument will not be passed to the model.
Optional
tags?: undefined | string[]Tags for this call and any sub-calls (eg. a Chain calling an LLM). You can use these to filter calls.
Optional
timeout?: undefined | numberTimeout for this call in milliseconds.
Optional
tools?: undefined | ChatOpenAIToolType[]A list of tools that the model may use to generate responses. Each tool can be a function, a built-in tool, or a custom tool definition. If not provided, the model will not use any tools.
Optional
verbosity?: undefined | OpenAIVerbosityParamThe verbosity of the model's response.
Parameters for audio output. Required when audio output is requested with
modalities: ["audio"]
. Learn more.