openai_struct/models/
computer_use_preview_tool.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 ComputerUsePreviewTool : A tool that controls a virtual computer. Learn more about the [computer tool](https:///platform.openai.com/docs/guides/tools-computer-use).
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// ComputerUsePreviewTool:
20///   properties:
21///     type:
22///       type: string
23///       enum:
24///         - computer_use_preview
25///       description: The type of the computer use tool. Always `computer_use_preview`.
26///       default: computer_use_preview
27///       x-stainless-const: true
28///     environment:
29///       type: string
30///       enum:
31///         - windows
32///         - mac
33///         - linux
34///         - ubuntu
35///         - browser
36///       description: The type of computer environment to control.
37///     display_width:
38///       type: integer
39///       description: The width of the computer display.
40///     display_height:
41///       type: integer
42///       description: The height of the computer display.
43///   type: object
44///   required:
45///     - type
46///     - environment
47///     - display_width
48///     - display_height
49///   title: Computer use preview
50///   description: A tool that controls a virtual computer. Learn more about the
51///     [computer tool](https:///platform.openai.com/docs/guides/tools-computer-use).
52/// ```
53#[derive(Debug, Serialize, Deserialize)]
54pub struct ComputerUsePreviewTool {
55    /// The height of the computer display.
56    #[serde(rename = "display_height")]
57    pub display_height: i32,
58    /// The width of the computer display.
59    #[serde(rename = "display_width")]
60    pub display_width: i32,
61    /// The type of computer environment to control.
62    #[serde(rename = "environment")]
63    pub environment: String,
64    /// The type of the computer use tool. Always `computer_use_preview`.
65    #[serde(rename = "type")]
66    #[serde(default = "default_type")]
67    pub _type: String,
68}
69
70fn default_type() -> String {
71    "computer_use_preview".into()
72}