openai_struct/models/batch_request_output.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 BatchRequestOutput : The per-line object of the batch output and error files
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// BatchRequestOutput:
20/// type: object
21/// description: The per-line object of the batch output and error files
22/// properties:
23/// id:
24/// type: string
25/// custom_id:
26/// type: string
27/// description:
28/// A developer-provided per-request id that will be used to match
29/// outputs to inputs.
30/// response:
31/// type: object
32/// nullable: true
33/// properties:
34/// status_code:
35/// type: integer
36/// description: The HTTP status code of the response
37/// request_id:
38/// type: string
39/// description:
40/// An unique identifier for the OpenAI API request. Please include
41/// this request ID when contacting support.
42/// body:
43/// type: object
44/// x-oaiTypeLabel: map
45/// description: The JSON body of the response
46/// error:
47/// type: object
48/// nullable: true
49/// description:
50/// For requests that failed with a non-HTTP error, this will contain
51/// more information on the cause of the failure.
52/// properties:
53/// code:
54/// type: string
55/// description: A machine-readable error code.
56/// message:
57/// type: string
58/// description: A human-readable error message.
59/// x-oaiMeta:
60/// name: The request output object
61/// example: >
62/// {"id": "batch_req_wnaDys", "custom_id": "request-2", "response":
63/// {"status_code": 200, "request_id": "req_c187b3", "body": {"id":
64/// "chatcmpl-9758Iw", "object": "chat.completion", "created": 1711475054,
65/// "model": "gpt-4o-mini", "choices": [{"index": 0, "message": {"role":
66/// "assistant", "content": "2 + 2 equals 4."}, "finish_reason": "stop"}],
67/// "usage": {"prompt_tokens": 24, "completion_tokens": 15,
68/// "total_tokens": 39}, "system_fingerprint": null}}, "error": null}
69/// ```
70#[derive(Debug, Serialize, Deserialize)]
71pub struct BatchRequestOutput {
72 /// A developer-provided per-request id that will be used to match outputs to inputs.
73 #[serde(rename = "custom_id")]
74 pub custom_id: Option<String>,
75 #[serde(rename = "error")]
76 pub error: Option<crate::models::BatchRequestOutputError>,
77 #[serde(rename = "id")]
78 pub id: Option<String>,
79 #[serde(rename = "response")]
80 pub response: Option<crate::models::BatchRequestOutputResponse>,
81}