CreateThreadAndRunOptionalParams interface
Optional parameters.
- Extends
Properties
| instructions | The overridden system instructions the agent should use to run the thread. |
| max |
The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only
the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens
specified, the run will end with status |
| max |
The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only
the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,
the run will end with status |
| metadata | A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. |
| model | The overridden model that the agent should use to run the thread. |
| parallel |
If |
| response |
Specifies the format that the model must output. |
| stream | If |
| temperature | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. |
| thread | The details used to create the new thread. If no thread is provided, an empty one will be created. |
| tool |
Controls whether or not and which tool is called by the model. |
| tool |
Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis |
| tools | The overridden list of enabled tools the agent should use to run the thread. |
| topP | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. |
| truncation |
The strategy to use for dropping messages as the context windows moves forward. |
Inherited Properties
| abort |
The signal which can be used to abort requests. |
| on |
A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times. |
| request |
Options used when creating and sending HTTP requests for this operation. |
| tracing |
Options used when tracing is enabled. |
Property Details
instructions
The overridden system instructions the agent should use to run the thread.
instructions?: string | null
Property Value
string | null
maxCompletionTokens
The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only
the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens
specified, the run will end with status incomplete. See incomplete_details for more info.
maxCompletionTokens?: number | null
Property Value
number | null
maxPromptTokens
The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only
the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,
the run will end with status incomplete. See incomplete_details for more info.
maxPromptTokens?: number | null
Property Value
number | null
metadata
A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
metadata?: Record<string, string> | null
Property Value
Record<string, string> | null
model
The overridden model that the agent should use to run the thread.
model?: string | null
Property Value
string | null
parallelToolCalls
If true functions will run in parallel during tool use.
parallelToolCalls?: boolean
Property Value
boolean
responseFormat
Specifies the format that the model must output.
responseFormat?: AgentsResponseFormatOption | null
Property Value
AgentsResponseFormatOption | null
stream
If true, returns a stream of events that happen during the Run as server-sent events,
terminating when the Run enters a terminal state with a data: [DONE] message.
stream?: boolean
Property Value
boolean
temperature
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
temperature?: number | null
Property Value
number | null
thread
The details used to create the new thread. If no thread is provided, an empty one will be created.
thread?: AgentThreadCreationOptions
Property Value
toolChoice
Controls whether or not and which tool is called by the model.
toolChoice?: AgentsToolChoiceOption | null
Property Value
AgentsToolChoiceOption | null
toolResources
Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis
toolResources?: ToolResources | null
Property Value
ToolResources | null
tools
The overridden list of enabled tools the agent should use to run the thread.
tools?: ToolDefinitionUnion[] | null
Property Value
ToolDefinitionUnion[] | null
topP
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
topP?: number | null
Property Value
number | null
truncationStrategy
The strategy to use for dropping messages as the context windows moves forward.
truncationStrategy?: TruncationObject | null
Property Value
TruncationObject | null
Inherited Property Details
abortSignal
The signal which can be used to abort requests.
abortSignal?: AbortSignalLike
Property Value
Inherited From OperationOptions.abortSignal
onResponse
A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.
onResponse?: RawResponseCallback
Property Value
Inherited From OperationOptions.onResponse
requestOptions
Options used when creating and sending HTTP requests for this operation.
requestOptions?: OperationRequestOptions
Property Value
Inherited From OperationOptions.requestOptions
tracingOptions
Options used when tracing is enabled.
tracingOptions?: OperationTracingOptions
Property Value
Inherited From OperationOptions.tracingOptions