openai_struct/models/
code_interpreter_tool_call.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/// pub CodeInterpreterToolCall : A tool call to run code.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// CodeInterpreterToolCall:
20///   type: object
21///   title: Code interpreter tool call
22///   description: |
23///     A tool call to run code.
24///   properties:
25///     id:
26///       type: string
27///       description: |
28///         The unique ID of the code interpreter tool call.
29///     type:
30///       type: string
31///       enum:
32///         - code_interpreter_call
33///       description: >
34///         The type of the code interpreter tool call. Always
35///         `code_interpreter_call`.
36///       x-stainless-const: true
37///     code:
38///       type: string
39///       description: |
40///         The code to run.
41///     status:
42///       type: string
43///       enum:
44///         - in_progress
45///         - interpreting
46///         - completed
47///       description: |
48///         The status of the code interpreter tool call.
49///     results:
50///       type: array
51///       items:
52///         $ref: "#/components/schemas/CodeInterpreterToolOutput"
53///       description: |
54///         The results of the code interpreter tool call.
55///   required:
56///     - id
57///     - type
58///     - code
59///     - status
60///     - results
61/// ```
62#[derive(Debug, Serialize, Deserialize)]
63pub struct CodeInterpreterToolCall {
64    /// The code to run.
65    #[serde(rename = "code")]
66    pub code: String,
67    /// The unique ID of the code interpreter tool call.
68    #[serde(rename = "id")]
69    pub id: String,
70    /// The results of the code interpreter tool call.
71    #[serde(rename = "results")]
72    pub results: Vec<crate::models::CodeInterpreterToolOutput>,
73    /// The status of the code interpreter tool call.
74    #[serde(rename = "status")]
75    pub status: String,
76    /// The type of the code interpreter tool call. Always `code_interpreter_call`.
77    #[serde(rename = "type")]
78    #[serde(default = "default_type")]
79    pub _type: String,
80}
81
82fn default_type() -> String {
83    "code_interpreter_call".into()
84}