class

OpenAI::CreateThreadAndRunRequest

Inherits JSON::Serializable < Reference < Object

Constructors

new(assistant_id : String = "", thread : CreateThreadRequest | Nil = nil, model : CreateThreadAndRunRequestModel | Nil = nil, instructions : String | Nil = nil, tools : Array(AssistantTool) | Nil = nil, tool_resources : CreateThreadAndRunRequestToolResources | Nil = nil, metadata : Metadata | Nil = nil, temperature : Float64 | Nil = nil, top_p : Float64 | Nil = nil, stream : Bool | Nil = nil, max_prompt_tokens : Int64 | Nil = nil, max_completion_tokens : Int64 | Nil = nil, truncation_strategy : CreateThreadAndRunRequestTruncationStrategy | Nil = nil, tool_choice : CreateThreadAndRunRequestToolChoice | Nil = nil, parallel_tool_calls : ParallelToolCalls | Nil = nil, response_format : AssistantsApiResponseFormatOption | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

assistant_id

The ID of the assistant to use to execute this run.

Source
assistant_id=(assistant_id : String)

The ID of the assistant to use to execute this run.

Source
instructions

Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.

Source
instructions=(instructions : String | Nil)

Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.

Source
max_completion_tokens

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.

Source
max_completion_tokens=(max_completion_tokens : Int64 | Nil)

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.

Source
max_prompt_tokens

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.

Source
max_prompt_tokens=(max_prompt_tokens : Int64 | Nil)

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.

Source
metadata
Source
metadata=(metadata : Metadata | Nil)
Source
model

The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.

Source
model=(model : CreateThreadAndRunRequestModel | Nil)

The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.

Source
parallel_tool_calls
Source
parallel_tool_calls=(parallel_tool_calls : ParallelToolCalls | Nil)
Source
response_format
Source
response_format=(response_format : AssistantsApiResponseFormatOption | Nil)
Source
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.

Source
stream=(stream : Bool | Nil)

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.

Source
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.

Source
temperature=(temperature : Float64 | Nil)

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.

Source
thread
Source
thread=(thread : CreateThreadRequest | Nil)
Source
tool_choice
Source
tool_choice=(tool_choice : CreateThreadAndRunRequestToolChoice | Nil)
Source
tool_resources

A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Source
tool_resources=(tool_resources : CreateThreadAndRunRequestToolResources | Nil)

A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

Source
tools

Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.

Source
tools=(tools : Array(AssistantTool) | Nil)

Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.

Source
top_p

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.

Source
top_p=(top_p : Float64 | Nil)

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.

Source
truncation_strategy
Source
truncation_strategy=(truncation_strategy : CreateThreadAndRunRequestTruncationStrategy | Nil)
Source