openai_struct/models/create_run_request.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11#[allow(unused_imports)]
12use serde_json::Value;
13
14#[derive(Debug, Serialize, Deserialize)]
15pub struct CreateRunRequest {
16 /// Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
17 #[serde(rename = "additional_instructions")]
18 pub additional_instructions: Option<String>,
19 /// Adds additional messages to the thread before creating the run.
20 #[serde(rename = "additional_messages")]
21 pub additional_messages: Option<Vec<crate::models::CreateMessageRequest>>,
22 /// The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run.
23 #[serde(rename = "assistant_id")]
24 pub assistant_id: String,
25 /// Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
26 #[serde(rename = "instructions")]
27 pub instructions: Option<String>,
28 /// 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.
29 #[serde(rename = "max_completion_tokens")]
30 pub max_completion_tokens: Option<i32>,
31 /// 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.
32 #[serde(rename = "max_prompt_tokens")]
33 pub max_prompt_tokens: Option<i32>,
34 #[serde(rename = "metadata")]
35 pub metadata: Option<crate::models::Metadata>,
36 /// The ID of the [Model](/docs/api-reference/models) 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.
37 #[serde(rename = "model")]
38 pub model: Option<Value>,
39 #[serde(rename = "parallel_tool_calls")]
40 pub parallel_tool_calls: Option<crate::models::ParallelToolCalls>,
41 #[serde(rename = "reasoning_effort")]
42 pub reasoning_effort: Option<crate::models::ReasoningEffort>,
43 #[serde(rename = "response_format")]
44 pub response_format: Option<crate::models::AssistantsApiResponseFormatOption>,
45 /// 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.
46 #[serde(rename = "stream")]
47 pub stream: Option<bool>,
48 /// 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.
49 #[serde(rename = "temperature")]
50 pub temperature: Option<f32>,
51 #[serde(rename = "tool_choice")]
52 pub tool_choice: Option<crate::models::CreateRunRequestToolChoice>,
53 /// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
54 #[serde(rename = "tools")]
55 pub tools: Option<Vec<Value>>,
56 /// 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.
57 #[serde(rename = "top_p")]
58 pub top_p: Option<f32>,
59 #[serde(rename = "truncation_strategy")]
60 pub truncation_strategy: Option<crate::models::CreateRunRequestToolChoice>,
61}