openai_struct/models/computer_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 ComputerToolCall : A tool call to a computer use tool. See the [computer use guide](/docs/guides/tools-computer-use) for more information.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// ComputerToolCall:
20/// type: object
21/// title: Computer tool call
22/// description: >
23/// A tool call to a computer use tool. See the
24///
25/// [computer use guide](/docs/guides/tools-computer-use) for more
26/// information.
27/// properties:
28/// type:
29/// type: string
30/// description: The type of the computer call. Always `computer_call`.
31/// enum:
32/// - computer_call
33/// default: computer_call
34/// id:
35/// type: string
36/// description: The unique ID of the computer call.
37/// call_id:
38/// type: string
39/// description: |
40/// An identifier used when responding to the tool call with output.
41/// action:
42/// $ref: "#/components/schemas/ComputerAction"
43/// pending_safety_checks:
44/// type: array
45/// items:
46/// $ref: "#/components/schemas/ComputerToolCallSafetyCheck"
47/// description: |
48/// The pending safety checks for the computer call.
49/// status:
50/// type: string
51/// description: |
52/// The status of the item. One of `in_progress`, `completed`, or
53/// `incomplete`. Populated when items are returned via API.
54/// enum:
55/// - in_progress
56/// - completed
57/// - incomplete
58/// required:
59/// - type
60/// - id
61/// - action
62/// - call_id
63/// - pending_safety_checks
64/// - status
65/// ```
66#[derive(Debug, Serialize, Deserialize)]
67pub struct ComputerToolCall {
68 #[serde(rename = "action")]
69 pub action: crate::models::ComputerAction,
70 /// An identifier used when responding to the tool call with output.
71 #[serde(rename = "call_id")]
72 pub call_id: String,
73 /// The unique ID of the computer call.
74 #[serde(rename = "id")]
75 pub id: String,
76 /// The pending safety checks for the computer call.
77 #[serde(rename = "pending_safety_checks")]
78 pub pending_safety_checks: Vec<crate::models::ComputerToolCallSafetyCheck>,
79 /// The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
80 #[serde(rename = "status")]
81 pub status: String,
82 /// The type of the computer call. Always `computer_call`.
83 #[serde(rename = "type")]
84 #[serde(default = "default_type")]
85 pub _type: String,
86}
87
88fn default_type() -> String {
89 "computer_call".into()
90}