Skip to content

Commit d573c80

Browse files
committed
Fix bug on yml file
1 parent 54c9cb9 commit d573c80

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

openai_client/openapi.documented.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28771,6 +28771,14 @@ components:
2877128771
description: >-
2877228772
The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`,
2877328773
`/v1/embeddings`, and `/v1/completions` are supported.
28774+
body:
28775+
oneOf:
28776+
- $ref: '#/components/schemas/CreateResponse'
28777+
required:
28778+
- custom_id
28779+
- method
28780+
- url
28781+
- body
2877428782
x-oaiMeta:
2877528783
name: The request input object
2877628784
example: >

openai_client/src/types.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,18 +1079,22 @@ pub enum BatchRequestInputMethod {
10791079
POST,
10801080
}
10811081

1082+
#[derive(Debug, PartialEq, Serialize, Deserialize)]
1083+
#[serde(untagged)]
1084+
pub enum BatchRequestInputBody {
1085+
CreateResponse(CreateResponse),
1086+
}
1087+
10821088
/** The per-line object of the batch input file */
10831089
#[derive(Debug, PartialEq, Serialize, Deserialize)]
10841090
pub struct BatchRequestInput {
10851091
/** A developer-provided per-request id that will be used to match outputs to inputs. Must be unique for each request in a batch. */
1086-
#[serde(skip_serializing_if = "Option::is_none")]
1087-
pub custom_id: Option<String>,
1092+
pub custom_id: String,
10881093
/** The HTTP method to be used for the request. Currently only `POST` is supported. */
1089-
#[serde(skip_serializing_if = "Option::is_none")]
1090-
pub method: Option<BatchRequestInputMethod>,
1094+
pub method: BatchRequestInputMethod,
10911095
/** The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. */
1092-
#[serde(skip_serializing_if = "Option::is_none")]
1093-
pub url: Option<String>,
1096+
pub url: String,
1097+
pub body: BatchRequestInputBody,
10941098
}
10951099

10961100
/** The JSON body of the response */

0 commit comments

Comments
 (0)