openai_struct/models/
batch_request_input.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 BatchRequestInput : The per-line object of the batch input file
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// BatchRequestInput:
20///   type: object
21///   description: The per-line object of the batch input file
22///   properties:
23///     custom_id:
24///       type: string
25///       description:
26///         A developer-provided per-request id that will be used to match
27///         outputs to inputs. Must be unique for each request in a batch.
28///     method:
29///       type: string
30///       enum:
31///         - POST
32///       description:
33///         The HTTP method to be used for the request. Currently only `POST`
34///         is supported.
35///       x-stainless-const: true
36///     url:
37///       type: string
38///       description:
39///         The OpenAI API relative URL to be used for the request. Currently
40///         `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are
41///         supported.
42///   x-oaiMeta:
43///     name: The request input object
44///     example: >
45///       {"custom_id": "request-1", "method": "POST", "url":
46///       "/v1/chat/completions", "body": {"model": "gpt-4o-mini", "messages":
47///       [{"role": "system", "content": "You are a helpful assistant."},
48///       {"role": "user", "content": "What is 2+2?"}]}}
49/// ```
50#[derive(Debug, Serialize, Deserialize)]
51pub struct BatchRequestInput {
52    /// A developer-provided per-request id that will be used to match outputs to inputs. Must be unique for each request in a batch.
53    #[serde(rename = "custom_id")]
54    pub custom_id: Option<String>,
55    /// The HTTP method to be used for the request. Currently only `POST` is supported.
56    #[serde(rename = "method")]
57    pub method: Option<String>,
58    /// The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported.
59    #[serde(rename = "url")]
60    pub url: Option<String>,
61}