inference_gateway_sdk/generated/schemas.rs
1// @generated - DO NOT EDIT.
2// Regenerate with `task generate-types` (or `cargo run -p gen-types --release`).
3// Source: openapi.yaml (components.schemas).
4
5#![allow(clippy::all)]
6#![allow(missing_docs)]
7#![allow(unused_imports)]
8#![allow(non_camel_case_types)]
9#![allow(dead_code)]
10
11/// Error types.
12pub mod error {
13 /// Error from a `TryFrom` or `FromStr` implementation.
14 pub struct ConversionError(::std::borrow::Cow<'static, str>);
15 impl ::std::error::Error for ConversionError {}
16 impl ::std::fmt::Display for ConversionError {
17 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
18 ::std::fmt::Display::fmt(&self.0, f)
19 }
20 }
21 impl ::std::fmt::Debug for ConversionError {
22 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
23 ::std::fmt::Debug::fmt(&self.0, f)
24 }
25 }
26 impl From<&'static str> for ConversionError {
27 fn from(value: &'static str) -> Self {
28 Self(value.into())
29 }
30 }
31 impl From<String> for ConversionError {
32 fn from(value: String) -> Self {
33 Self(value.into())
34 }
35 }
36}
37///`ChatCompletionChoice`
38///
39/// <details><summary>JSON schema</summary>
40///
41/// ```json
42///{
43/// "type": "object",
44/// "required": [
45/// "finish_reason",
46/// "index",
47/// "message"
48/// ],
49/// "properties": {
50/// "finish_reason": {
51/// "$ref": "#/definitions/FinishReason"
52/// },
53/// "index": {
54/// "description": "The index of the choice in the list of choices.",
55/// "type": "integer"
56/// },
57/// "logprobs": {
58/// "description": "Log probability information for the choice.",
59/// "type": "object",
60/// "required": [
61/// "content",
62/// "refusal"
63/// ],
64/// "properties": {
65/// "content": {
66/// "description": "A list of message content tokens with log probability information.",
67/// "type": "array",
68/// "items": {
69/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
70/// }
71/// },
72/// "refusal": {
73/// "description": "A list of message refusal tokens with log probability information.",
74/// "type": "array",
75/// "items": {
76/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
77/// }
78/// }
79/// },
80/// "nullable": true
81/// },
82/// "message": {
83/// "$ref": "#/definitions/Message"
84/// }
85/// }
86///}
87/// ```
88/// </details>
89#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
90pub struct ChatCompletionChoice {
91 pub finish_reason: FinishReason,
92 ///The index of the choice in the list of choices.
93 pub index: i64,
94 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
95 pub logprobs: ::std::option::Option<ChatCompletionChoiceLogprobs>,
96 pub message: Message,
97}
98///Log probability information for the choice.
99///
100/// <details><summary>JSON schema</summary>
101///
102/// ```json
103///{
104/// "description": "Log probability information for the choice.",
105/// "type": "object",
106/// "required": [
107/// "content",
108/// "refusal"
109/// ],
110/// "properties": {
111/// "content": {
112/// "description": "A list of message content tokens with log probability information.",
113/// "type": "array",
114/// "items": {
115/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
116/// }
117/// },
118/// "refusal": {
119/// "description": "A list of message refusal tokens with log probability information.",
120/// "type": "array",
121/// "items": {
122/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
123/// }
124/// }
125/// },
126/// "nullable": true
127///}
128/// ```
129/// </details>
130#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
131pub struct ChatCompletionChoiceLogprobs {
132 ///A list of message content tokens with log probability information.
133 pub content: ::std::vec::Vec<ChatCompletionTokenLogprob>,
134 ///A list of message refusal tokens with log probability information.
135 pub refusal: ::std::vec::Vec<ChatCompletionTokenLogprob>,
136}
137///`ChatCompletionMessageToolCall`
138///
139/// <details><summary>JSON schema</summary>
140///
141/// ```json
142///{
143/// "type": "object",
144/// "required": [
145/// "function",
146/// "id",
147/// "type"
148/// ],
149/// "properties": {
150/// "extra_content": {
151/// "$ref": "#/definitions/ToolCallExtraContent"
152/// },
153/// "function": {
154/// "$ref": "#/definitions/ChatCompletionMessageToolCallFunction"
155/// },
156/// "id": {
157/// "description": "The ID of the tool call.",
158/// "type": "string"
159/// },
160/// "type": {
161/// "$ref": "#/definitions/ChatCompletionToolType"
162/// }
163/// }
164///}
165/// ```
166/// </details>
167#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
168pub struct ChatCompletionMessageToolCall {
169 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
170 pub extra_content: ::std::option::Option<ToolCallExtraContent>,
171 pub function: ChatCompletionMessageToolCallFunction,
172 ///The ID of the tool call.
173 pub id: ::std::string::String,
174 #[serde(rename = "type")]
175 pub type_: ChatCompletionToolType,
176}
177///`ChatCompletionMessageToolCallChunk`
178///
179/// <details><summary>JSON schema</summary>
180///
181/// ```json
182///{
183/// "type": "object",
184/// "required": [
185/// "index"
186/// ],
187/// "properties": {
188/// "extra_content": {
189/// "$ref": "#/definitions/ToolCallExtraContent"
190/// },
191/// "function": {
192/// "$ref": "#/definitions/ChatCompletionMessageToolCallFunction"
193/// },
194/// "id": {
195/// "description": "The ID of the tool call.",
196/// "type": "string"
197/// },
198/// "index": {
199/// "type": "integer"
200/// },
201/// "type": {
202/// "description": "The type of the tool. Currently, only `function` is supported.",
203/// "type": "string"
204/// }
205/// }
206///}
207/// ```
208/// </details>
209#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
210pub struct ChatCompletionMessageToolCallChunk {
211 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
212 pub extra_content: ::std::option::Option<ToolCallExtraContent>,
213 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
214 pub function: ::std::option::Option<ChatCompletionMessageToolCallFunction>,
215 ///The ID of the tool call.
216 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
217 pub id: ::std::option::Option<::std::string::String>,
218 pub index: i64,
219 ///The type of the tool. Currently, only `function` is supported.
220 #[serde(
221 rename = "type",
222 default,
223 skip_serializing_if = "::std::option::Option::is_none"
224 )]
225 pub type_: ::std::option::Option<::std::string::String>,
226}
227///The function that the model called.
228///
229/// <details><summary>JSON schema</summary>
230///
231/// ```json
232///{
233/// "description": "The function that the model called.",
234/// "type": "object",
235/// "required": [
236/// "arguments",
237/// "name"
238/// ],
239/// "properties": {
240/// "arguments": {
241/// "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
242/// "type": "string"
243/// },
244/// "name": {
245/// "description": "The name of the function to call.",
246/// "type": "string"
247/// }
248/// }
249///}
250/// ```
251/// </details>
252#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
253pub struct ChatCompletionMessageToolCallFunction {
254 ///The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
255 pub arguments: ::std::string::String,
256 ///The name of the function to call.
257 pub name: ::std::string::String,
258}
259/**Specifies a tool the model should use. Use to force the model to call a specific function.
260*/
261///
262/// <details><summary>JSON schema</summary>
263///
264/// ```json
265///{
266/// "description": "Specifies a tool the model should use. Use to force the model to call a specific function.\n",
267/// "type": "object",
268/// "required": [
269/// "function",
270/// "type"
271/// ],
272/// "properties": {
273/// "function": {
274/// "type": "object",
275/// "required": [
276/// "name"
277/// ],
278/// "properties": {
279/// "name": {
280/// "description": "The name of the function to call.",
281/// "type": "string"
282/// }
283/// }
284/// },
285/// "type": {
286/// "$ref": "#/definitions/ChatCompletionToolType"
287/// }
288/// }
289///}
290/// ```
291/// </details>
292#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
293pub struct ChatCompletionNamedToolChoice {
294 pub function: ChatCompletionNamedToolChoiceFunction,
295 #[serde(rename = "type")]
296 pub type_: ChatCompletionToolType,
297}
298///`ChatCompletionNamedToolChoiceFunction`
299///
300/// <details><summary>JSON schema</summary>
301///
302/// ```json
303///{
304/// "type": "object",
305/// "required": [
306/// "name"
307/// ],
308/// "properties": {
309/// "name": {
310/// "description": "The name of the function to call.",
311/// "type": "string"
312/// }
313/// }
314///}
315/// ```
316/// </details>
317#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
318pub struct ChatCompletionNamedToolChoiceFunction {
319 ///The name of the function to call.
320 pub name: ::std::string::String,
321}
322///`ChatCompletionStreamChoice`
323///
324/// <details><summary>JSON schema</summary>
325///
326/// ```json
327///{
328/// "type": "object",
329/// "required": [
330/// "delta",
331/// "index"
332/// ],
333/// "properties": {
334/// "delta": {
335/// "$ref": "#/definitions/ChatCompletionStreamResponseDelta"
336/// },
337/// "finish_reason": {
338/// "$ref": "#/definitions/FinishReason"
339/// },
340/// "index": {
341/// "description": "The index of the choice in the list of choices.",
342/// "type": "integer"
343/// },
344/// "logprobs": {
345/// "description": "Log probability information for the choice.",
346/// "type": "object",
347/// "required": [
348/// "content",
349/// "refusal"
350/// ],
351/// "properties": {
352/// "content": {
353/// "description": "A list of message content tokens with log probability information.",
354/// "type": "array",
355/// "items": {
356/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
357/// }
358/// },
359/// "refusal": {
360/// "description": "A list of message refusal tokens with log probability information.",
361/// "type": "array",
362/// "items": {
363/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
364/// }
365/// }
366/// }
367/// }
368/// }
369///}
370/// ```
371/// </details>
372#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
373pub struct ChatCompletionStreamChoice {
374 pub delta: ChatCompletionStreamResponseDelta,
375 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
376 pub finish_reason: ::std::option::Option<FinishReason>,
377 ///The index of the choice in the list of choices.
378 pub index: i64,
379 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
380 pub logprobs: ::std::option::Option<ChatCompletionStreamChoiceLogprobs>,
381}
382///Log probability information for the choice.
383///
384/// <details><summary>JSON schema</summary>
385///
386/// ```json
387///{
388/// "description": "Log probability information for the choice.",
389/// "type": "object",
390/// "required": [
391/// "content",
392/// "refusal"
393/// ],
394/// "properties": {
395/// "content": {
396/// "description": "A list of message content tokens with log probability information.",
397/// "type": "array",
398/// "items": {
399/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
400/// }
401/// },
402/// "refusal": {
403/// "description": "A list of message refusal tokens with log probability information.",
404/// "type": "array",
405/// "items": {
406/// "$ref": "#/definitions/ChatCompletionTokenLogprob"
407/// }
408/// }
409/// }
410///}
411/// ```
412/// </details>
413#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
414pub struct ChatCompletionStreamChoiceLogprobs {
415 ///A list of message content tokens with log probability information.
416 pub content: ::std::vec::Vec<ChatCompletionTokenLogprob>,
417 ///A list of message refusal tokens with log probability information.
418 pub refusal: ::std::vec::Vec<ChatCompletionTokenLogprob>,
419}
420/**Options for streaming response. Only set this when you set `stream: true`.
421*/
422///
423/// <details><summary>JSON schema</summary>
424///
425/// ```json
426///{
427/// "description": "Options for streaming response. Only set this when you set `stream: true`.\n",
428/// "type": "object",
429/// "required": [
430/// "include_usage"
431/// ],
432/// "properties": {
433/// "include_usage": {
434/// "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n",
435/// "type": "boolean"
436/// }
437/// }
438///}
439/// ```
440/// </details>
441#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
442pub struct ChatCompletionStreamOptions {
443 /**If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.
444 */
445 pub include_usage: bool,
446}
447///A chat completion delta generated by streamed model responses.
448///
449/// <details><summary>JSON schema</summary>
450///
451/// ```json
452///{
453/// "description": "A chat completion delta generated by streamed model responses.",
454/// "type": "object",
455/// "properties": {
456/// "content": {
457/// "description": "The contents of the chunk message.",
458/// "type": "string"
459/// },
460/// "reasoning": {
461/// "description": "The reasoning of the chunk message. Same as reasoning_content.",
462/// "type": "string"
463/// },
464/// "reasoning_content": {
465/// "description": "The reasoning content of the chunk message.",
466/// "type": "string"
467/// },
468/// "refusal": {
469/// "description": "The refusal message generated by the model.",
470/// "type": "string"
471/// },
472/// "role": {
473/// "$ref": "#/definitions/MessageRole"
474/// },
475/// "tool_calls": {
476/// "type": "array",
477/// "items": {
478/// "$ref": "#/definitions/ChatCompletionMessageToolCallChunk"
479/// }
480/// }
481/// }
482///}
483/// ```
484/// </details>
485#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
486pub struct ChatCompletionStreamResponseDelta {
487 ///The contents of the chunk message.
488 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
489 pub content: ::std::option::Option<::std::string::String>,
490 ///The reasoning of the chunk message. Same as reasoning_content.
491 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
492 pub reasoning: ::std::option::Option<::std::string::String>,
493 ///The reasoning content of the chunk message.
494 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
495 pub reasoning_content: ::std::option::Option<::std::string::String>,
496 ///The refusal message generated by the model.
497 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
498 pub refusal: ::std::option::Option<::std::string::String>,
499 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
500 pub role: ::std::option::Option<MessageRole>,
501 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
502 pub tool_calls: ::std::vec::Vec<ChatCompletionMessageToolCallChunk>,
503}
504impl ::std::default::Default for ChatCompletionStreamResponseDelta {
505 fn default() -> Self {
506 Self {
507 content: Default::default(),
508 reasoning: Default::default(),
509 reasoning_content: Default::default(),
510 refusal: Default::default(),
511 role: Default::default(),
512 tool_calls: Default::default(),
513 }
514 }
515}
516///`ChatCompletionTokenLogprob`
517///
518/// <details><summary>JSON schema</summary>
519///
520/// ```json
521///{
522/// "type": "object",
523/// "required": [
524/// "bytes",
525/// "logprob",
526/// "token",
527/// "top_logprobs"
528/// ],
529/// "properties": {
530/// "bytes": {
531/// "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
532/// "type": "array",
533/// "items": {
534/// "type": "integer"
535/// }
536/// },
537/// "logprob": {
538/// "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.",
539/// "type": "number"
540/// },
541/// "token": {
542/// "description": "The token.",
543/// "type": "string"
544/// },
545/// "top_logprobs": {
546/// "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.",
547/// "type": "array",
548/// "items": {
549/// "type": "object",
550/// "required": [
551/// "bytes",
552/// "logprob",
553/// "token"
554/// ],
555/// "properties": {
556/// "bytes": {
557/// "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
558/// "type": "array",
559/// "items": {
560/// "type": "integer"
561/// }
562/// },
563/// "logprob": {
564/// "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.",
565/// "type": "number"
566/// },
567/// "token": {
568/// "description": "The token.",
569/// "type": "string"
570/// }
571/// }
572/// }
573/// }
574/// }
575///}
576/// ```
577/// </details>
578#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
579pub struct ChatCompletionTokenLogprob {
580 ///A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
581 pub bytes: ::std::vec::Vec<i64>,
582 ///The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
583 pub logprob: f64,
584 ///The token.
585 pub token: ::std::string::String,
586 ///List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
587 pub top_logprobs: ::std::vec::Vec<ChatCompletionTokenLogprobTopLogprobsItem>,
588}
589///`ChatCompletionTokenLogprobTopLogprobsItem`
590///
591/// <details><summary>JSON schema</summary>
592///
593/// ```json
594///{
595/// "type": "object",
596/// "required": [
597/// "bytes",
598/// "logprob",
599/// "token"
600/// ],
601/// "properties": {
602/// "bytes": {
603/// "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.",
604/// "type": "array",
605/// "items": {
606/// "type": "integer"
607/// }
608/// },
609/// "logprob": {
610/// "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.",
611/// "type": "number"
612/// },
613/// "token": {
614/// "description": "The token.",
615/// "type": "string"
616/// }
617/// }
618///}
619/// ```
620/// </details>
621#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
622pub struct ChatCompletionTokenLogprobTopLogprobsItem {
623 ///A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
624 pub bytes: ::std::vec::Vec<i64>,
625 ///The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
626 pub logprob: f64,
627 ///The token.
628 pub token: ::std::string::String,
629}
630///`ChatCompletionTool`
631///
632/// <details><summary>JSON schema</summary>
633///
634/// ```json
635///{
636/// "type": "object",
637/// "required": [
638/// "function",
639/// "type"
640/// ],
641/// "properties": {
642/// "function": {
643/// "$ref": "#/definitions/FunctionObject"
644/// },
645/// "type": {
646/// "$ref": "#/definitions/ChatCompletionToolType"
647/// }
648/// }
649///}
650/// ```
651/// </details>
652#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
653pub struct ChatCompletionTool {
654 pub function: FunctionObject,
655 #[serde(rename = "type")]
656 pub type_: ChatCompletionToolType,
657}
658/**Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
659`none` is the default when no tools are present. `auto` is the default if tools are present.
660*/
661///
662/// <details><summary>JSON schema</summary>
663///
664/// ```json
665///{
666/// "description": "Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n",
667/// "oneOf": [
668/// {
669/// "description": "`none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.\n",
670/// "type": "string",
671/// "enum": [
672/// "none",
673/// "auto",
674/// "required"
675/// ]
676/// },
677/// {
678/// "$ref": "#/definitions/ChatCompletionNamedToolChoice"
679/// }
680/// ]
681///}
682/// ```
683/// </details>
684#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
685#[serde(untagged)]
686pub enum ChatCompletionToolChoiceOption {
687 String(ChatCompletionToolChoiceOptionString),
688 ChatCompletionNamedToolChoice(ChatCompletionNamedToolChoice),
689}
690impl ::std::convert::From<ChatCompletionToolChoiceOptionString> for ChatCompletionToolChoiceOption {
691 fn from(value: ChatCompletionToolChoiceOptionString) -> Self {
692 Self::String(value)
693 }
694}
695impl ::std::convert::From<ChatCompletionNamedToolChoice> for ChatCompletionToolChoiceOption {
696 fn from(value: ChatCompletionNamedToolChoice) -> Self {
697 Self::ChatCompletionNamedToolChoice(value)
698 }
699}
700/**`none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.
701*/
702///
703/// <details><summary>JSON schema</summary>
704///
705/// ```json
706///{
707/// "description": "`none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools.\n",
708/// "type": "string",
709/// "enum": [
710/// "none",
711/// "auto",
712/// "required"
713/// ]
714///}
715/// ```
716/// </details>
717#[derive(
718 ::serde::Deserialize,
719 ::serde::Serialize,
720 Clone,
721 Copy,
722 Debug,
723 Eq,
724 Hash,
725 Ord,
726 PartialEq,
727 PartialOrd,
728)]
729pub enum ChatCompletionToolChoiceOptionString {
730 #[serde(rename = "none")]
731 None,
732 #[serde(rename = "auto")]
733 Auto,
734 #[serde(rename = "required")]
735 Required,
736}
737impl ::std::fmt::Display for ChatCompletionToolChoiceOptionString {
738 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
739 match *self {
740 Self::None => f.write_str("none"),
741 Self::Auto => f.write_str("auto"),
742 Self::Required => f.write_str("required"),
743 }
744 }
745}
746impl ::std::str::FromStr for ChatCompletionToolChoiceOptionString {
747 type Err = self::error::ConversionError;
748 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
749 match value {
750 "none" => Ok(Self::None),
751 "auto" => Ok(Self::Auto),
752 "required" => Ok(Self::Required),
753 _ => Err("invalid value".into()),
754 }
755 }
756}
757impl ::std::convert::TryFrom<&str> for ChatCompletionToolChoiceOptionString {
758 type Error = self::error::ConversionError;
759 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
760 value.parse()
761 }
762}
763impl ::std::convert::TryFrom<&::std::string::String> for ChatCompletionToolChoiceOptionString {
764 type Error = self::error::ConversionError;
765 fn try_from(
766 value: &::std::string::String,
767 ) -> ::std::result::Result<Self, self::error::ConversionError> {
768 value.parse()
769 }
770}
771impl ::std::convert::TryFrom<::std::string::String> for ChatCompletionToolChoiceOptionString {
772 type Error = self::error::ConversionError;
773 fn try_from(
774 value: ::std::string::String,
775 ) -> ::std::result::Result<Self, self::error::ConversionError> {
776 value.parse()
777 }
778}
779///The type of the tool. Currently, only `function` is supported.
780///
781/// <details><summary>JSON schema</summary>
782///
783/// ```json
784///{
785/// "description": "The type of the tool. Currently, only `function` is supported.",
786/// "type": "string",
787/// "enum": [
788/// "function"
789/// ]
790///}
791/// ```
792/// </details>
793#[derive(
794 ::serde::Deserialize,
795 ::serde::Serialize,
796 Clone,
797 Copy,
798 Debug,
799 Eq,
800 Hash,
801 Ord,
802 PartialEq,
803 PartialOrd,
804)]
805pub enum ChatCompletionToolType {
806 #[serde(rename = "function")]
807 Function,
808}
809impl ::std::fmt::Display for ChatCompletionToolType {
810 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
811 match *self {
812 Self::Function => f.write_str("function"),
813 }
814 }
815}
816impl ::std::str::FromStr for ChatCompletionToolType {
817 type Err = self::error::ConversionError;
818 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
819 match value {
820 "function" => Ok(Self::Function),
821 _ => Err("invalid value".into()),
822 }
823 }
824}
825impl ::std::convert::TryFrom<&str> for ChatCompletionToolType {
826 type Error = self::error::ConversionError;
827 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
828 value.parse()
829 }
830}
831impl ::std::convert::TryFrom<&::std::string::String> for ChatCompletionToolType {
832 type Error = self::error::ConversionError;
833 fn try_from(
834 value: &::std::string::String,
835 ) -> ::std::result::Result<Self, self::error::ConversionError> {
836 value.parse()
837 }
838}
839impl ::std::convert::TryFrom<::std::string::String> for ChatCompletionToolType {
840 type Error = self::error::ConversionError;
841 fn try_from(
842 value: ::std::string::String,
843 ) -> ::std::result::Result<Self, self::error::ConversionError> {
844 value.parse()
845 }
846}
847///Usage statistics for the completion request.
848///
849/// <details><summary>JSON schema</summary>
850///
851/// ```json
852///{
853/// "description": "Usage statistics for the completion request.",
854/// "type": "object",
855/// "required": [
856/// "completion_tokens",
857/// "prompt_tokens",
858/// "total_tokens"
859/// ],
860/// "properties": {
861/// "completion_tokens": {
862/// "description": "Number of tokens in the generated completion.",
863/// "default": 0,
864/// "type": "integer",
865/// "format": "int64"
866/// },
867/// "prompt_tokens": {
868/// "description": "Number of tokens in the prompt.",
869/// "default": 0,
870/// "type": "integer",
871/// "format": "int64"
872/// },
873/// "total_tokens": {
874/// "description": "Total number of tokens used in the request (prompt + completion).",
875/// "default": 0,
876/// "type": "integer",
877/// "format": "int64"
878/// }
879/// }
880///}
881/// ```
882/// </details>
883#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
884pub struct CompletionUsage {
885 ///Number of tokens in the generated completion.
886 pub completion_tokens: i64,
887 ///Number of tokens in the prompt.
888 pub prompt_tokens: i64,
889 ///Total number of tokens used in the request (prompt + completion).
890 pub total_tokens: i64,
891}
892///`Config`
893///
894/// <details><summary>JSON schema</summary>
895///
896/// ```json
897///{}
898/// ```
899/// </details>
900#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
901#[serde(transparent)]
902pub struct Config(pub ::serde_json::Value);
903impl ::std::ops::Deref for Config {
904 type Target = ::serde_json::Value;
905 fn deref(&self) -> &::serde_json::Value {
906 &self.0
907 }
908}
909impl ::std::convert::From<Config> for ::serde_json::Value {
910 fn from(value: Config) -> Self {
911 value.0
912 }
913}
914impl ::std::convert::From<::serde_json::Value> for Config {
915 fn from(value: ::serde_json::Value) -> Self {
916 Self(value)
917 }
918}
919///A content part within a multimodal message
920///
921/// <details><summary>JSON schema</summary>
922///
923/// ```json
924///{
925/// "description": "A content part within a multimodal message",
926/// "type": "object",
927/// "oneOf": [
928/// {
929/// "$ref": "#/definitions/TextContentPart"
930/// },
931/// {
932/// "$ref": "#/definitions/ImageContentPart"
933/// }
934/// ]
935///}
936/// ```
937/// </details>
938#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
939#[serde(untagged)]
940pub enum ContentPart {
941 TextContentPart(TextContentPart),
942 ImageContentPart(ImageContentPart),
943}
944impl ::std::convert::From<TextContentPart> for ContentPart {
945 fn from(value: TextContentPart) -> Self {
946 Self::TextContentPart(value)
947 }
948}
949impl ::std::convert::From<ImageContentPart> for ContentPart {
950 fn from(value: ImageContentPart) -> Self {
951 Self::ImageContentPart(value)
952 }
953}
954///`CreateChatCompletionRequest`
955///
956/// <details><summary>JSON schema</summary>
957///
958/// ```json
959///{
960/// "type": "object",
961/// "required": [
962/// "messages",
963/// "model"
964/// ],
965/// "properties": {
966/// "frequency_penalty": {
967/// "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n",
968/// "default": 0,
969/// "type": "number",
970/// "maximum": 2.0,
971/// "minimum": -2.0
972/// },
973/// "logit_bias": {
974/// "description": "Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. The bias is added to the logits generated by the model prior to sampling.\n",
975/// "type": "object",
976/// "additionalProperties": {
977/// "type": "integer"
978/// }
979/// },
980/// "logprobs": {
981/// "description": "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.\n",
982/// "default": false,
983/// "type": "boolean"
984/// },
985/// "max_completion_tokens": {
986/// "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.\n",
987/// "type": "integer"
988/// },
989/// "max_tokens": {
990/// "description": "The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o-series models.\n",
991/// "deprecated": true,
992/// "type": "integer"
993/// },
994/// "messages": {
995/// "description": "A list of messages comprising the conversation so far.\n",
996/// "type": "array",
997/// "items": {
998/// "$ref": "#/definitions/Message"
999/// },
1000/// "minItems": 1
1001/// },
1002/// "model": {
1003/// "description": "Model ID to use",
1004/// "type": "string"
1005/// },
1006/// "n": {
1007/// "description": "How many chat completion choices to generate for each input message.\n",
1008/// "default": 1,
1009/// "type": "integer",
1010/// "maximum": 128.0,
1011/// "minimum": 1.0
1012/// },
1013/// "parallel_tool_calls": {
1014/// "description": "Whether to enable parallel function calling during tool use.\n",
1015/// "default": true,
1016/// "type": "boolean"
1017/// },
1018/// "presence_penalty": {
1019/// "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n",
1020/// "default": 0,
1021/// "type": "number",
1022/// "maximum": 2.0,
1023/// "minimum": -2.0
1024/// },
1025/// "reasoning_effort": {
1026/// "description": "Constrains effort on reasoning for reasoning models. Currently supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.\n",
1027/// "type": "string",
1028/// "enum": [
1029/// "minimal",
1030/// "low",
1031/// "medium",
1032/// "high"
1033/// ]
1034/// },
1035/// "reasoning_format": {
1036/// "description": "The format of the reasoning content. Can be `raw` or `parsed`.\nWhen specified as raw some reasoning models will output <think /> tags. When specified as parsed the model will output the reasoning under `reasoning` or `reasoning_content` attribute.\n",
1037/// "type": "string"
1038/// },
1039/// "response_format": {
1040/// "description": "An object specifying the format that the model must output. Setting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema. Setting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which ensures the message the model generates is valid JSON.\n",
1041/// "oneOf": [
1042/// {
1043/// "$ref": "#/definitions/ResponseFormatText"
1044/// },
1045/// {
1046/// "$ref": "#/definitions/ResponseFormatJsonSchema"
1047/// },
1048/// {
1049/// "$ref": "#/definitions/ResponseFormatJsonObject"
1050/// }
1051/// ]
1052/// },
1053/// "seed": {
1054/// "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n",
1055/// "type": "integer"
1056/// },
1057/// "stop": {
1058/// "description": "Up to 4 sequences where the API will stop generating further tokens.\n",
1059/// "oneOf": [
1060/// {
1061/// "type": "string"
1062/// },
1063/// {
1064/// "type": "array",
1065/// "items": {
1066/// "type": "string"
1067/// },
1068/// "maxItems": 4,
1069/// "minItems": 1
1070/// }
1071/// ]
1072/// },
1073/// "stream": {
1074/// "description": "If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).\n",
1075/// "default": false,
1076/// "type": "boolean"
1077/// },
1078/// "stream_options": {
1079/// "$ref": "#/definitions/ChatCompletionStreamOptions"
1080/// },
1081/// "temperature": {
1082/// "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n",
1083/// "default": 1,
1084/// "type": "number",
1085/// "maximum": 2.0,
1086/// "minimum": 0.0
1087/// },
1088/// "tool_choice": {
1089/// "$ref": "#/definitions/ChatCompletionToolChoiceOption"
1090/// },
1091/// "tools": {
1092/// "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.\n",
1093/// "type": "array",
1094/// "items": {
1095/// "$ref": "#/definitions/ChatCompletionTool"
1096/// }
1097/// },
1098/// "top_logprobs": {
1099/// "description": "An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.\n",
1100/// "type": "integer",
1101/// "maximum": 20.0,
1102/// "minimum": 0.0
1103/// },
1104/// "top_p": {
1105/// "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.\n",
1106/// "default": 1,
1107/// "type": "number",
1108/// "maximum": 1.0,
1109/// "minimum": 0.0
1110/// },
1111/// "user": {
1112/// "description": "A unique identifier representing your end-user, which can help to monitor and detect abuse.\n",
1113/// "type": "string"
1114/// }
1115/// }
1116///}
1117/// ```
1118/// </details>
1119#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1120pub struct CreateChatCompletionRequest {
1121 /**Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
1122 */
1123 #[serde(default = "defaults::create_chat_completion_request_frequency_penalty")]
1124 pub frequency_penalty: f64,
1125 /**Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. The bias is added to the logits generated by the model prior to sampling.
1126 */
1127 #[serde(
1128 default,
1129 skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
1130 )]
1131 pub logit_bias: ::std::collections::HashMap<::std::string::String, i64>,
1132 /**Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.
1133 */
1134 #[serde(default)]
1135 pub logprobs: bool,
1136 /**An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
1137 */
1138 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1139 pub max_completion_tokens: ::std::option::Option<i64>,
1140 /**The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o-series models.
1141 */
1142 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1143 pub max_tokens: ::std::option::Option<i64>,
1144 /**A list of messages comprising the conversation so far.
1145 */
1146 pub messages: ::std::vec::Vec<Message>,
1147 ///Model ID to use
1148 pub model: ::std::string::String,
1149 /**How many chat completion choices to generate for each input message.
1150 */
1151 #[serde(default = "defaults::default_nzu64::<::std::num::NonZeroU64, 1>")]
1152 pub n: ::std::num::NonZeroU64,
1153 /**Whether to enable parallel function calling during tool use.
1154 */
1155 #[serde(default = "defaults::default_bool::<true>")]
1156 pub parallel_tool_calls: bool,
1157 /**Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
1158 */
1159 #[serde(default = "defaults::create_chat_completion_request_presence_penalty")]
1160 pub presence_penalty: f64,
1161 /**Constrains effort on reasoning for reasoning models. Currently supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
1162 */
1163 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1164 pub reasoning_effort: ::std::option::Option<CreateChatCompletionRequestReasoningEffort>,
1165 /**The format of the reasoning content. Can be `raw` or `parsed`.
1166 When specified as raw some reasoning models will output <think /> tags. When specified as parsed the model will output the reasoning under `reasoning` or `reasoning_content` attribute.
1167 */
1168 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1169 pub reasoning_format: ::std::option::Option<::std::string::String>,
1170 /**An object specifying the format that the model must output. Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema. Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON.
1171 */
1172 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1173 pub response_format: ::std::option::Option<CreateChatCompletionRequestResponseFormat>,
1174 /**If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
1175 */
1176 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1177 pub seed: ::std::option::Option<i64>,
1178 /**Up to 4 sequences where the API will stop generating further tokens.
1179 */
1180 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1181 pub stop: ::std::option::Option<CreateChatCompletionRequestStop>,
1182 /**If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
1183 */
1184 #[serde(default)]
1185 pub stream: bool,
1186 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1187 pub stream_options: ::std::option::Option<ChatCompletionStreamOptions>,
1188 /**What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1189 */
1190 #[serde(default = "defaults::create_chat_completion_request_temperature")]
1191 pub temperature: f64,
1192 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1193 pub tool_choice: ::std::option::Option<ChatCompletionToolChoiceOption>,
1194 /**A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
1195 */
1196 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
1197 pub tools: ::std::vec::Vec<ChatCompletionTool>,
1198 /**An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.
1199 */
1200 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1201 pub top_logprobs: ::std::option::Option<i64>,
1202 /**An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
1203 */
1204 #[serde(default = "defaults::create_chat_completion_request_top_p")]
1205 pub top_p: f64,
1206 /**A unique identifier representing your end-user, which can help to monitor and detect abuse.
1207 */
1208 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1209 pub user: ::std::option::Option<::std::string::String>,
1210}
1211/**Constrains effort on reasoning for reasoning models. Currently supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
1212*/
1213///
1214/// <details><summary>JSON schema</summary>
1215///
1216/// ```json
1217///{
1218/// "description": "Constrains effort on reasoning for reasoning models. Currently supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.\n",
1219/// "type": "string",
1220/// "enum": [
1221/// "minimal",
1222/// "low",
1223/// "medium",
1224/// "high"
1225/// ]
1226///}
1227/// ```
1228/// </details>
1229#[derive(
1230 ::serde::Deserialize,
1231 ::serde::Serialize,
1232 Clone,
1233 Copy,
1234 Debug,
1235 Eq,
1236 Hash,
1237 Ord,
1238 PartialEq,
1239 PartialOrd,
1240)]
1241pub enum CreateChatCompletionRequestReasoningEffort {
1242 #[serde(rename = "minimal")]
1243 Minimal,
1244 #[serde(rename = "low")]
1245 Low,
1246 #[serde(rename = "medium")]
1247 Medium,
1248 #[serde(rename = "high")]
1249 High,
1250}
1251impl ::std::fmt::Display for CreateChatCompletionRequestReasoningEffort {
1252 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1253 match *self {
1254 Self::Minimal => f.write_str("minimal"),
1255 Self::Low => f.write_str("low"),
1256 Self::Medium => f.write_str("medium"),
1257 Self::High => f.write_str("high"),
1258 }
1259 }
1260}
1261impl ::std::str::FromStr for CreateChatCompletionRequestReasoningEffort {
1262 type Err = self::error::ConversionError;
1263 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1264 match value {
1265 "minimal" => Ok(Self::Minimal),
1266 "low" => Ok(Self::Low),
1267 "medium" => Ok(Self::Medium),
1268 "high" => Ok(Self::High),
1269 _ => Err("invalid value".into()),
1270 }
1271 }
1272}
1273impl ::std::convert::TryFrom<&str> for CreateChatCompletionRequestReasoningEffort {
1274 type Error = self::error::ConversionError;
1275 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1276 value.parse()
1277 }
1278}
1279impl ::std::convert::TryFrom<&::std::string::String>
1280 for CreateChatCompletionRequestReasoningEffort
1281{
1282 type Error = self::error::ConversionError;
1283 fn try_from(
1284 value: &::std::string::String,
1285 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1286 value.parse()
1287 }
1288}
1289impl ::std::convert::TryFrom<::std::string::String> for CreateChatCompletionRequestReasoningEffort {
1290 type Error = self::error::ConversionError;
1291 fn try_from(
1292 value: ::std::string::String,
1293 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1294 value.parse()
1295 }
1296}
1297/**An object specifying the format that the model must output. Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema. Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON.
1298*/
1299///
1300/// <details><summary>JSON schema</summary>
1301///
1302/// ```json
1303///{
1304/// "description": "An object specifying the format that the model must output. Setting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema. Setting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which ensures the message the model generates is valid JSON.\n",
1305/// "oneOf": [
1306/// {
1307/// "$ref": "#/definitions/ResponseFormatText"
1308/// },
1309/// {
1310/// "$ref": "#/definitions/ResponseFormatJsonSchema"
1311/// },
1312/// {
1313/// "$ref": "#/definitions/ResponseFormatJsonObject"
1314/// }
1315/// ]
1316///}
1317/// ```
1318/// </details>
1319#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1320#[serde(untagged)]
1321pub enum CreateChatCompletionRequestResponseFormat {
1322 Text(ResponseFormatText),
1323 JsonSchema(ResponseFormatJsonSchema),
1324 JsonObject(ResponseFormatJsonObject),
1325}
1326impl ::std::convert::From<ResponseFormatText> for CreateChatCompletionRequestResponseFormat {
1327 fn from(value: ResponseFormatText) -> Self {
1328 Self::Text(value)
1329 }
1330}
1331impl ::std::convert::From<ResponseFormatJsonSchema> for CreateChatCompletionRequestResponseFormat {
1332 fn from(value: ResponseFormatJsonSchema) -> Self {
1333 Self::JsonSchema(value)
1334 }
1335}
1336impl ::std::convert::From<ResponseFormatJsonObject> for CreateChatCompletionRequestResponseFormat {
1337 fn from(value: ResponseFormatJsonObject) -> Self {
1338 Self::JsonObject(value)
1339 }
1340}
1341/**Up to 4 sequences where the API will stop generating further tokens.
1342*/
1343///
1344/// <details><summary>JSON schema</summary>
1345///
1346/// ```json
1347///{
1348/// "description": "Up to 4 sequences where the API will stop generating further tokens.\n",
1349/// "oneOf": [
1350/// {
1351/// "type": "string"
1352/// },
1353/// {
1354/// "type": "array",
1355/// "items": {
1356/// "type": "string"
1357/// },
1358/// "maxItems": 4,
1359/// "minItems": 1
1360/// }
1361/// ]
1362///}
1363/// ```
1364/// </details>
1365#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1366#[serde(untagged)]
1367pub enum CreateChatCompletionRequestStop {
1368 String(::std::string::String),
1369 Array(::std::vec::Vec<::std::string::String>),
1370}
1371impl ::std::convert::From<::std::vec::Vec<::std::string::String>>
1372 for CreateChatCompletionRequestStop
1373{
1374 fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
1375 Self::Array(value)
1376 }
1377}
1378///Represents a chat completion response returned by model, based on the provided input.
1379///
1380/// <details><summary>JSON schema</summary>
1381///
1382/// ```json
1383///{
1384/// "description": "Represents a chat completion response returned by model, based on the provided input.",
1385/// "type": "object",
1386/// "required": [
1387/// "choices",
1388/// "created",
1389/// "id",
1390/// "model",
1391/// "object"
1392/// ],
1393/// "properties": {
1394/// "choices": {
1395/// "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1.",
1396/// "type": "array",
1397/// "items": {
1398/// "$ref": "#/definitions/ChatCompletionChoice"
1399/// }
1400/// },
1401/// "created": {
1402/// "description": "The Unix timestamp (in seconds) of when the chat completion was created.",
1403/// "type": "integer"
1404/// },
1405/// "id": {
1406/// "description": "A unique identifier for the chat completion.",
1407/// "type": "string"
1408/// },
1409/// "model": {
1410/// "description": "The model used for the chat completion.",
1411/// "type": "string"
1412/// },
1413/// "object": {
1414/// "description": "The object type, which is always `chat.completion`.",
1415/// "type": "string"
1416/// },
1417/// "usage": {
1418/// "$ref": "#/definitions/CompletionUsage"
1419/// }
1420/// }
1421///}
1422/// ```
1423/// </details>
1424#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1425pub struct CreateChatCompletionResponse {
1426 ///A list of chat completion choices. Can be more than one if `n` is greater than 1.
1427 pub choices: ::std::vec::Vec<ChatCompletionChoice>,
1428 ///The Unix timestamp (in seconds) of when the chat completion was created.
1429 pub created: i64,
1430 ///A unique identifier for the chat completion.
1431 pub id: ::std::string::String,
1432 ///The model used for the chat completion.
1433 pub model: ::std::string::String,
1434 ///The object type, which is always `chat.completion`.
1435 pub object: ::std::string::String,
1436 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1437 pub usage: ::std::option::Option<CompletionUsage>,
1438}
1439/**Represents a streamed chunk of a chat completion response returned
1440by the model, based on the provided input.
1441*/
1442///
1443/// <details><summary>JSON schema</summary>
1444///
1445/// ```json
1446///{
1447/// "description": "Represents a streamed chunk of a chat completion response returned\nby the model, based on the provided input.\n",
1448/// "type": "object",
1449/// "required": [
1450/// "choices",
1451/// "created",
1452/// "id",
1453/// "model",
1454/// "object"
1455/// ],
1456/// "properties": {
1457/// "choices": {
1458/// "description": "A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the\nlast chunk if you set `stream_options: {\"include_usage\": true}`.\n",
1459/// "type": "array",
1460/// "items": {
1461/// "$ref": "#/definitions/ChatCompletionStreamChoice"
1462/// }
1463/// },
1464/// "created": {
1465/// "description": "The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.",
1466/// "type": "integer"
1467/// },
1468/// "id": {
1469/// "description": "A unique identifier for the chat completion. Each chunk has the same ID.",
1470/// "type": "string"
1471/// },
1472/// "model": {
1473/// "description": "The model to generate the completion.",
1474/// "type": "string"
1475/// },
1476/// "object": {
1477/// "description": "The object type, which is always `chat.completion.chunk`.",
1478/// "type": "string"
1479/// },
1480/// "reasoning_format": {
1481/// "description": "The format of the reasoning content. Can be `raw` or `parsed`.\nWhen specified as raw some reasoning models will output <think /> tags. When specified as parsed the model will output the reasoning under reasoning_content.\n",
1482/// "type": "string"
1483/// },
1484/// "system_fingerprint": {
1485/// "description": "This fingerprint represents the backend configuration that the model runs with.\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.\n",
1486/// "type": "string"
1487/// },
1488/// "usage": {
1489/// "$ref": "#/definitions/CompletionUsage"
1490/// }
1491/// }
1492///}
1493/// ```
1494/// </details>
1495#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1496pub struct CreateChatCompletionStreamResponse {
1497 /**A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the
1498 last chunk if you set `stream_options: {"include_usage": true}`.
1499 */
1500 pub choices: ::std::vec::Vec<ChatCompletionStreamChoice>,
1501 ///The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
1502 pub created: i64,
1503 ///A unique identifier for the chat completion. Each chunk has the same ID.
1504 pub id: ::std::string::String,
1505 ///The model to generate the completion.
1506 pub model: ::std::string::String,
1507 ///The object type, which is always `chat.completion.chunk`.
1508 pub object: ::std::string::String,
1509 /**The format of the reasoning content. Can be `raw` or `parsed`.
1510 When specified as raw some reasoning models will output <think /> tags. When specified as parsed the model will output the reasoning under reasoning_content.
1511 */
1512 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1513 pub reasoning_format: ::std::option::Option<::std::string::String>,
1514 /**This fingerprint represents the backend configuration that the model runs with.
1515 Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
1516 */
1517 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1518 pub system_fingerprint: ::std::option::Option<::std::string::String>,
1519 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1520 pub usage: ::std::option::Option<CompletionUsage>,
1521}
1522/**Request body for creating a model response via the Responses API.
1523*/
1524///
1525/// <details><summary>JSON schema</summary>
1526///
1527/// ```json
1528///{
1529/// "description": "Request body for creating a model response via the Responses API.\n",
1530/// "type": "object",
1531/// "required": [
1532/// "input",
1533/// "model"
1534/// ],
1535/// "properties": {
1536/// "background": {
1537/// "description": "Whether to run the model response in the background. Useful for long-running or batched requests.\n",
1538/// "default": false,
1539/// "type": "boolean"
1540/// },
1541/// "input": {
1542/// "$ref": "#/definitions/ResponseInput"
1543/// },
1544/// "instructions": {
1545/// "description": "A system (or developer) message inserted into the model's context. When used with `previous_response_id`, instructions from previous responses are not carried over.\n",
1546/// "type": "string",
1547/// "nullable": true
1548/// },
1549/// "max_output_tokens": {
1550/// "description": "An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.\n",
1551/// "type": "integer",
1552/// "nullable": true
1553/// },
1554/// "metadata": {
1555/// "description": "Set of up to 16 key-value pairs that can be attached to the object and returned when retrieving the response.\n",
1556/// "type": "object",
1557/// "additionalProperties": {
1558/// "type": "string"
1559/// }
1560/// },
1561/// "model": {
1562/// "description": "Model ID used to generate the response.",
1563/// "type": "string"
1564/// },
1565/// "parallel_tool_calls": {
1566/// "description": "Whether to allow the model to run tool calls in parallel.",
1567/// "default": true,
1568/// "type": "boolean"
1569/// },
1570/// "previous_response_id": {
1571/// "description": "The unique ID of the previous response to the model. Use this to create multi-turn conversations.\n",
1572/// "type": "string",
1573/// "nullable": true
1574/// },
1575/// "reasoning": {
1576/// "$ref": "#/definitions/ResponseReasoning"
1577/// },
1578/// "store": {
1579/// "description": "Whether to store the generated model response for later retrieval.\n",
1580/// "default": true,
1581/// "type": "boolean"
1582/// },
1583/// "stream": {
1584/// "description": "If set to true, the model response data is streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).\n",
1585/// "default": false,
1586/// "type": "boolean"
1587/// },
1588/// "temperature": {
1589/// "description": "What sampling temperature to use, between 0 and 2. Higher values make the output more random; lower values make it more focused.\n",
1590/// "default": 1,
1591/// "type": "number",
1592/// "format": "float",
1593/// "nullable": true
1594/// },
1595/// "text": {
1596/// "$ref": "#/definitions/ResponseTextConfig"
1597/// },
1598/// "tool_choice": {
1599/// "$ref": "#/definitions/ResponseToolChoice"
1600/// },
1601/// "tools": {
1602/// "description": "An array of tools the model may call while generating a response.\n",
1603/// "type": "array",
1604/// "items": {
1605/// "$ref": "#/definitions/ResponseTool"
1606/// }
1607/// },
1608/// "top_p": {
1609/// "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the tokens with `top_p` probability mass.\n",
1610/// "default": 1,
1611/// "type": "number",
1612/// "format": "float",
1613/// "nullable": true
1614/// },
1615/// "user": {
1616/// "description": "A stable identifier for your end-users, used to help detect and prevent abuse.\n",
1617/// "type": "string"
1618/// }
1619/// }
1620///}
1621/// ```
1622/// </details>
1623#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1624pub struct CreateResponseRequest {
1625 /**Whether to run the model response in the background. Useful for long-running or batched requests.
1626 */
1627 #[serde(default)]
1628 pub background: bool,
1629 pub input: ResponseInput,
1630 /**A system (or developer) message inserted into the model's context. When used with `previous_response_id`, instructions from previous responses are not carried over.
1631 */
1632 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1633 pub instructions: ::std::option::Option<::std::string::String>,
1634 /**An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
1635 */
1636 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1637 pub max_output_tokens: ::std::option::Option<i64>,
1638 /**Set of up to 16 key-value pairs that can be attached to the object and returned when retrieving the response.
1639 */
1640 #[serde(
1641 default,
1642 skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
1643 )]
1644 pub metadata: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
1645 ///Model ID used to generate the response.
1646 pub model: ::std::string::String,
1647 ///Whether to allow the model to run tool calls in parallel.
1648 #[serde(default = "defaults::default_bool::<true>")]
1649 pub parallel_tool_calls: bool,
1650 /**The unique ID of the previous response to the model. Use this to create multi-turn conversations.
1651 */
1652 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1653 pub previous_response_id: ::std::option::Option<::std::string::String>,
1654 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1655 pub reasoning: ::std::option::Option<ResponseReasoning>,
1656 /**Whether to store the generated model response for later retrieval.
1657 */
1658 #[serde(default = "defaults::default_bool::<true>")]
1659 pub store: bool,
1660 /**If set to true, the model response data is streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
1661 */
1662 #[serde(default)]
1663 pub stream: bool,
1664 /**What sampling temperature to use, between 0 and 2. Higher values make the output more random; lower values make it more focused.
1665 */
1666 #[serde(default = "defaults::create_response_request_temperature")]
1667 pub temperature: f32,
1668 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1669 pub text: ::std::option::Option<ResponseTextConfig>,
1670 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1671 pub tool_choice: ::std::option::Option<ResponseToolChoice>,
1672 /**An array of tools the model may call while generating a response.
1673 */
1674 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
1675 pub tools: ::std::vec::Vec<ResponseTool>,
1676 /**An alternative to sampling with temperature, called nucleus sampling, where the model considers the tokens with `top_p` probability mass.
1677 */
1678 #[serde(default = "defaults::create_response_request_top_p")]
1679 pub top_p: f32,
1680 /**A stable identifier for your end-users, used to help detect and prevent abuse.
1681 */
1682 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1683 pub user: ::std::option::Option<::std::string::String>,
1684}
1685///`Endpoints`
1686///
1687/// <details><summary>JSON schema</summary>
1688///
1689/// ```json
1690///{
1691/// "type": "object",
1692/// "required": [
1693/// "chat",
1694/// "models"
1695/// ],
1696/// "properties": {
1697/// "chat": {
1698/// "type": "string"
1699/// },
1700/// "models": {
1701/// "type": "string"
1702/// },
1703/// "responses": {
1704/// "type": "string"
1705/// }
1706/// }
1707///}
1708/// ```
1709/// </details>
1710#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1711pub struct Endpoints {
1712 pub chat: ::std::string::String,
1713 pub models: ::std::string::String,
1714 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1715 pub responses: ::std::option::Option<::std::string::String>,
1716}
1717///`Error`
1718///
1719/// <details><summary>JSON schema</summary>
1720///
1721/// ```json
1722///{
1723/// "type": "object",
1724/// "properties": {
1725/// "error": {
1726/// "type": "string"
1727/// }
1728/// }
1729///}
1730/// ```
1731/// </details>
1732#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1733pub struct Error {
1734 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1735 pub error: ::std::option::Option<::std::string::String>,
1736}
1737impl ::std::default::Default for Error {
1738 fn default() -> Self {
1739 Self {
1740 error: Default::default(),
1741 }
1742 }
1743}
1744/**The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
1745`length` if the maximum number of tokens specified in the request was reached,
1746`content_filter` if content was omitted due to a flag from our content filters,
1747`tool_calls` if the model called a tool.
1748*/
1749///
1750/// <details><summary>JSON schema</summary>
1751///
1752/// ```json
1753///{
1754/// "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool.\n",
1755/// "type": "string",
1756/// "enum": [
1757/// "stop",
1758/// "length",
1759/// "tool_calls",
1760/// "content_filter",
1761/// "function_call"
1762/// ]
1763///}
1764/// ```
1765/// </details>
1766#[derive(
1767 ::serde::Deserialize,
1768 ::serde::Serialize,
1769 Clone,
1770 Copy,
1771 Debug,
1772 Eq,
1773 Hash,
1774 Ord,
1775 PartialEq,
1776 PartialOrd,
1777)]
1778pub enum FinishReason {
1779 #[serde(rename = "stop")]
1780 Stop,
1781 #[serde(rename = "length")]
1782 Length,
1783 #[serde(rename = "tool_calls")]
1784 ToolCalls,
1785 #[serde(rename = "content_filter")]
1786 ContentFilter,
1787 #[serde(rename = "function_call")]
1788 FunctionCall,
1789}
1790impl ::std::fmt::Display for FinishReason {
1791 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1792 match *self {
1793 Self::Stop => f.write_str("stop"),
1794 Self::Length => f.write_str("length"),
1795 Self::ToolCalls => f.write_str("tool_calls"),
1796 Self::ContentFilter => f.write_str("content_filter"),
1797 Self::FunctionCall => f.write_str("function_call"),
1798 }
1799 }
1800}
1801impl ::std::str::FromStr for FinishReason {
1802 type Err = self::error::ConversionError;
1803 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1804 match value {
1805 "stop" => Ok(Self::Stop),
1806 "length" => Ok(Self::Length),
1807 "tool_calls" => Ok(Self::ToolCalls),
1808 "content_filter" => Ok(Self::ContentFilter),
1809 "function_call" => Ok(Self::FunctionCall),
1810 _ => Err("invalid value".into()),
1811 }
1812 }
1813}
1814impl ::std::convert::TryFrom<&str> for FinishReason {
1815 type Error = self::error::ConversionError;
1816 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1817 value.parse()
1818 }
1819}
1820impl ::std::convert::TryFrom<&::std::string::String> for FinishReason {
1821 type Error = self::error::ConversionError;
1822 fn try_from(
1823 value: &::std::string::String,
1824 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1825 value.parse()
1826 }
1827}
1828impl ::std::convert::TryFrom<::std::string::String> for FinishReason {
1829 type Error = self::error::ConversionError;
1830 fn try_from(
1831 value: ::std::string::String,
1832 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1833 value.parse()
1834 }
1835}
1836///`FunctionObject`
1837///
1838/// <details><summary>JSON schema</summary>
1839///
1840/// ```json
1841///{
1842/// "type": "object",
1843/// "required": [
1844/// "name"
1845/// ],
1846/// "properties": {
1847/// "description": {
1848/// "description": "A description of what the function does, used by the model to choose when and how to call the function.",
1849/// "type": "string"
1850/// },
1851/// "name": {
1852/// "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.",
1853/// "type": "string"
1854/// },
1855/// "parameters": {
1856/// "$ref": "#/definitions/FunctionParameters"
1857/// },
1858/// "strict": {
1859/// "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).",
1860/// "default": false,
1861/// "type": "boolean"
1862/// }
1863/// }
1864///}
1865/// ```
1866/// </details>
1867#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1868pub struct FunctionObject {
1869 ///A description of what the function does, used by the model to choose when and how to call the function.
1870 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1871 pub description: ::std::option::Option<::std::string::String>,
1872 ///The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
1873 pub name: ::std::string::String,
1874 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1875 pub parameters: ::std::option::Option<FunctionParameters>,
1876 ///Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).
1877 #[serde(default)]
1878 pub strict: bool,
1879}
1880/**The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
1881Omitting `parameters` defines a function with an empty parameter list.*/
1882///
1883/// <details><summary>JSON schema</summary>
1884///
1885/// ```json
1886///{
1887/// "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \nOmitting `parameters` defines a function with an empty parameter list.",
1888/// "type": "object",
1889/// "additionalProperties": true
1890///}
1891/// ```
1892/// </details>
1893#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1894#[serde(transparent)]
1895pub struct FunctionParameters(pub ::serde_json::Map<::std::string::String, ::serde_json::Value>);
1896impl ::std::ops::Deref for FunctionParameters {
1897 type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
1898 fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
1899 &self.0
1900 }
1901}
1902impl ::std::convert::From<FunctionParameters>
1903 for ::serde_json::Map<::std::string::String, ::serde_json::Value>
1904{
1905 fn from(value: FunctionParameters) -> Self {
1906 value.0
1907 }
1908}
1909impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
1910 for FunctionParameters
1911{
1912 fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
1913 Self(value)
1914 }
1915}
1916///Image content part
1917///
1918/// <details><summary>JSON schema</summary>
1919///
1920/// ```json
1921///{
1922/// "description": "Image content part",
1923/// "type": "object",
1924/// "required": [
1925/// "image_url",
1926/// "type"
1927/// ],
1928/// "properties": {
1929/// "image_url": {
1930/// "$ref": "#/definitions/ImageURL"
1931/// },
1932/// "type": {
1933/// "description": "Content type identifier",
1934/// "type": "string",
1935/// "enum": [
1936/// "image_url"
1937/// ]
1938/// }
1939/// }
1940///}
1941/// ```
1942/// </details>
1943#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1944pub struct ImageContentPart {
1945 pub image_url: ImageUrl,
1946 ///Content type identifier
1947 #[serde(rename = "type")]
1948 pub type_: ImageContentPartType,
1949}
1950///Content type identifier
1951///
1952/// <details><summary>JSON schema</summary>
1953///
1954/// ```json
1955///{
1956/// "description": "Content type identifier",
1957/// "type": "string",
1958/// "enum": [
1959/// "image_url"
1960/// ]
1961///}
1962/// ```
1963/// </details>
1964#[derive(
1965 ::serde::Deserialize,
1966 ::serde::Serialize,
1967 Clone,
1968 Copy,
1969 Debug,
1970 Eq,
1971 Hash,
1972 Ord,
1973 PartialEq,
1974 PartialOrd,
1975)]
1976pub enum ImageContentPartType {
1977 #[serde(rename = "image_url")]
1978 ImageUrl,
1979}
1980impl ::std::fmt::Display for ImageContentPartType {
1981 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1982 match *self {
1983 Self::ImageUrl => f.write_str("image_url"),
1984 }
1985 }
1986}
1987impl ::std::str::FromStr for ImageContentPartType {
1988 type Err = self::error::ConversionError;
1989 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1990 match value {
1991 "image_url" => Ok(Self::ImageUrl),
1992 _ => Err("invalid value".into()),
1993 }
1994 }
1995}
1996impl ::std::convert::TryFrom<&str> for ImageContentPartType {
1997 type Error = self::error::ConversionError;
1998 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1999 value.parse()
2000 }
2001}
2002impl ::std::convert::TryFrom<&::std::string::String> for ImageContentPartType {
2003 type Error = self::error::ConversionError;
2004 fn try_from(
2005 value: &::std::string::String,
2006 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2007 value.parse()
2008 }
2009}
2010impl ::std::convert::TryFrom<::std::string::String> for ImageContentPartType {
2011 type Error = self::error::ConversionError;
2012 fn try_from(
2013 value: ::std::string::String,
2014 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2015 value.parse()
2016 }
2017}
2018///Image URL configuration
2019///
2020/// <details><summary>JSON schema</summary>
2021///
2022/// ```json
2023///{
2024/// "description": "Image URL configuration",
2025/// "type": "object",
2026/// "required": [
2027/// "url"
2028/// ],
2029/// "properties": {
2030/// "detail": {
2031/// "description": "Image detail level for vision processing",
2032/// "default": "auto",
2033/// "type": "string",
2034/// "enum": [
2035/// "auto",
2036/// "low",
2037/// "high"
2038/// ]
2039/// },
2040/// "url": {
2041/// "description": "URL of the image (data URLs supported)",
2042/// "type": "string"
2043/// }
2044/// }
2045///}
2046/// ```
2047/// </details>
2048#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2049pub struct ImageUrl {
2050 ///Image detail level for vision processing
2051 #[serde(default = "defaults::image_url_detail")]
2052 pub detail: ImageUrlDetail,
2053 ///URL of the image (data URLs supported)
2054 pub url: ::std::string::String,
2055}
2056///Image detail level for vision processing
2057///
2058/// <details><summary>JSON schema</summary>
2059///
2060/// ```json
2061///{
2062/// "description": "Image detail level for vision processing",
2063/// "default": "auto",
2064/// "type": "string",
2065/// "enum": [
2066/// "auto",
2067/// "low",
2068/// "high"
2069/// ]
2070///}
2071/// ```
2072/// </details>
2073#[derive(
2074 ::serde::Deserialize,
2075 ::serde::Serialize,
2076 Clone,
2077 Copy,
2078 Debug,
2079 Eq,
2080 Hash,
2081 Ord,
2082 PartialEq,
2083 PartialOrd,
2084)]
2085pub enum ImageUrlDetail {
2086 #[serde(rename = "auto")]
2087 Auto,
2088 #[serde(rename = "low")]
2089 Low,
2090 #[serde(rename = "high")]
2091 High,
2092}
2093impl ::std::fmt::Display for ImageUrlDetail {
2094 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2095 match *self {
2096 Self::Auto => f.write_str("auto"),
2097 Self::Low => f.write_str("low"),
2098 Self::High => f.write_str("high"),
2099 }
2100 }
2101}
2102impl ::std::str::FromStr for ImageUrlDetail {
2103 type Err = self::error::ConversionError;
2104 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2105 match value {
2106 "auto" => Ok(Self::Auto),
2107 "low" => Ok(Self::Low),
2108 "high" => Ok(Self::High),
2109 _ => Err("invalid value".into()),
2110 }
2111 }
2112}
2113impl ::std::convert::TryFrom<&str> for ImageUrlDetail {
2114 type Error = self::error::ConversionError;
2115 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2116 value.parse()
2117 }
2118}
2119impl ::std::convert::TryFrom<&::std::string::String> for ImageUrlDetail {
2120 type Error = self::error::ConversionError;
2121 fn try_from(
2122 value: &::std::string::String,
2123 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2124 value.parse()
2125 }
2126}
2127impl ::std::convert::TryFrom<::std::string::String> for ImageUrlDetail {
2128 type Error = self::error::ConversionError;
2129 fn try_from(
2130 value: ::std::string::String,
2131 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2132 value.parse()
2133 }
2134}
2135impl ::std::default::Default for ImageUrlDetail {
2136 fn default() -> Self {
2137 ImageUrlDetail::Auto
2138 }
2139}
2140///Response structure for listing models
2141///
2142/// <details><summary>JSON schema</summary>
2143///
2144/// ```json
2145///{
2146/// "description": "Response structure for listing models",
2147/// "type": "object",
2148/// "required": [
2149/// "data",
2150/// "object"
2151/// ],
2152/// "properties": {
2153/// "data": {
2154/// "default": [],
2155/// "type": "array",
2156/// "items": {
2157/// "$ref": "#/definitions/Model"
2158/// }
2159/// },
2160/// "object": {
2161/// "type": "string"
2162/// },
2163/// "provider": {
2164/// "$ref": "#/definitions/Provider"
2165/// }
2166/// }
2167///}
2168/// ```
2169/// </details>
2170#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2171pub struct ListModelsResponse {
2172 pub data: ::std::vec::Vec<Model>,
2173 pub object: ::std::string::String,
2174 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2175 pub provider: ::std::option::Option<Provider>,
2176}
2177///Response structure for listing MCP tools
2178///
2179/// <details><summary>JSON schema</summary>
2180///
2181/// ```json
2182///{
2183/// "description": "Response structure for listing MCP tools",
2184/// "type": "object",
2185/// "required": [
2186/// "data",
2187/// "object"
2188/// ],
2189/// "properties": {
2190/// "data": {
2191/// "description": "Array of available MCP tools",
2192/// "default": [],
2193/// "type": "array",
2194/// "items": {
2195/// "$ref": "#/definitions/MCPTool"
2196/// }
2197/// },
2198/// "object": {
2199/// "description": "Always \"list\"",
2200/// "type": "string"
2201/// }
2202/// }
2203///}
2204/// ```
2205/// </details>
2206#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2207pub struct ListToolsResponse {
2208 ///Array of available MCP tools
2209 pub data: ::std::vec::Vec<McpTool>,
2210 ///Always "list"
2211 pub object: ::std::string::String,
2212}
2213///An MCP tool definition
2214///
2215/// <details><summary>JSON schema</summary>
2216///
2217/// ```json
2218///{
2219/// "description": "An MCP tool definition",
2220/// "type": "object",
2221/// "required": [
2222/// "description",
2223/// "name",
2224/// "server"
2225/// ],
2226/// "properties": {
2227/// "description": {
2228/// "description": "A description of what the tool does",
2229/// "type": "string"
2230/// },
2231/// "input_schema": {
2232/// "description": "JSON schema for the tool's input parameters",
2233/// "type": "object",
2234/// "additionalProperties": true
2235/// },
2236/// "name": {
2237/// "description": "The name of the tool",
2238/// "type": "string"
2239/// },
2240/// "server": {
2241/// "description": "The MCP server that provides this tool",
2242/// "type": "string"
2243/// }
2244/// }
2245///}
2246/// ```
2247/// </details>
2248#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2249pub struct McpTool {
2250 ///A description of what the tool does
2251 pub description: ::std::string::String,
2252 ///JSON schema for the tool's input parameters
2253 #[serde(default, skip_serializing_if = "::serde_json::Map::is_empty")]
2254 pub input_schema: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
2255 ///The name of the tool
2256 pub name: ::std::string::String,
2257 ///The MCP server that provides this tool
2258 pub server: ::std::string::String,
2259}
2260///Message structure for provider requests
2261///
2262/// <details><summary>JSON schema</summary>
2263///
2264/// ```json
2265///{
2266/// "description": "Message structure for provider requests",
2267/// "type": "object",
2268/// "required": [
2269/// "content",
2270/// "role"
2271/// ],
2272/// "properties": {
2273/// "content": {
2274/// "$ref": "#/definitions/MessageContent"
2275/// },
2276/// "reasoning": {
2277/// "description": "The reasoning of the chunk message. Same as reasoning_content.",
2278/// "type": "string"
2279/// },
2280/// "reasoning_content": {
2281/// "description": "The reasoning content of the chunk message.",
2282/// "type": "string"
2283/// },
2284/// "role": {
2285/// "$ref": "#/definitions/MessageRole"
2286/// },
2287/// "tool_call_id": {
2288/// "type": "string"
2289/// },
2290/// "tool_calls": {
2291/// "type": "array",
2292/// "items": {
2293/// "$ref": "#/definitions/ChatCompletionMessageToolCall"
2294/// }
2295/// }
2296/// }
2297///}
2298/// ```
2299/// </details>
2300#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2301pub struct Message {
2302 pub content: MessageContent,
2303 ///The reasoning of the chunk message. Same as reasoning_content.
2304 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2305 pub reasoning: ::std::option::Option<::std::string::String>,
2306 ///The reasoning content of the chunk message.
2307 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2308 pub reasoning_content: ::std::option::Option<::std::string::String>,
2309 pub role: MessageRole,
2310 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2311 pub tool_call_id: ::std::option::Option<::std::string::String>,
2312 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2313 pub tool_calls: ::std::vec::Vec<ChatCompletionMessageToolCall>,
2314}
2315///Message content - either text or multimodal content parts
2316///
2317/// <details><summary>JSON schema</summary>
2318///
2319/// ```json
2320///{
2321/// "description": "Message content - either text or multimodal content parts",
2322/// "oneOf": [
2323/// {
2324/// "description": "Text content (backward compatibility)",
2325/// "type": "string"
2326/// },
2327/// {
2328/// "description": "Array of content parts for multimodal messages",
2329/// "type": "array",
2330/// "items": {
2331/// "$ref": "#/definitions/ContentPart"
2332/// }
2333/// }
2334/// ]
2335///}
2336/// ```
2337/// </details>
2338#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2339#[serde(untagged)]
2340pub enum MessageContent {
2341 String(::std::string::String),
2342 Array(::std::vec::Vec<ContentPart>),
2343}
2344impl ::std::convert::From<::std::vec::Vec<ContentPart>> for MessageContent {
2345 fn from(value: ::std::vec::Vec<ContentPart>) -> Self {
2346 Self::Array(value)
2347 }
2348}
2349///Role of the message sender
2350///
2351/// <details><summary>JSON schema</summary>
2352///
2353/// ```json
2354///{
2355/// "description": "Role of the message sender",
2356/// "type": "string",
2357/// "enum": [
2358/// "system",
2359/// "user",
2360/// "assistant",
2361/// "tool"
2362/// ]
2363///}
2364/// ```
2365/// </details>
2366#[derive(
2367 ::serde::Deserialize,
2368 ::serde::Serialize,
2369 Clone,
2370 Copy,
2371 Debug,
2372 Eq,
2373 Hash,
2374 Ord,
2375 PartialEq,
2376 PartialOrd,
2377)]
2378pub enum MessageRole {
2379 #[serde(rename = "system")]
2380 System,
2381 #[serde(rename = "user")]
2382 User,
2383 #[serde(rename = "assistant")]
2384 Assistant,
2385 #[serde(rename = "tool")]
2386 Tool,
2387}
2388impl ::std::fmt::Display for MessageRole {
2389 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2390 match *self {
2391 Self::System => f.write_str("system"),
2392 Self::User => f.write_str("user"),
2393 Self::Assistant => f.write_str("assistant"),
2394 Self::Tool => f.write_str("tool"),
2395 }
2396 }
2397}
2398impl ::std::str::FromStr for MessageRole {
2399 type Err = self::error::ConversionError;
2400 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2401 match value {
2402 "system" => Ok(Self::System),
2403 "user" => Ok(Self::User),
2404 "assistant" => Ok(Self::Assistant),
2405 "tool" => Ok(Self::Tool),
2406 _ => Err("invalid value".into()),
2407 }
2408 }
2409}
2410impl ::std::convert::TryFrom<&str> for MessageRole {
2411 type Error = self::error::ConversionError;
2412 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2413 value.parse()
2414 }
2415}
2416impl ::std::convert::TryFrom<&::std::string::String> for MessageRole {
2417 type Error = self::error::ConversionError;
2418 fn try_from(
2419 value: &::std::string::String,
2420 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2421 value.parse()
2422 }
2423}
2424impl ::std::convert::TryFrom<::std::string::String> for MessageRole {
2425 type Error = self::error::ConversionError;
2426 fn try_from(
2427 value: ::std::string::String,
2428 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2429 value.parse()
2430 }
2431}
2432///Common model information
2433///
2434/// <details><summary>JSON schema</summary>
2435///
2436/// ```json
2437///{
2438/// "description": "Common model information",
2439/// "type": "object",
2440/// "required": [
2441/// "created",
2442/// "id",
2443/// "object",
2444/// "owned_by",
2445/// "served_by"
2446/// ],
2447/// "properties": {
2448/// "created": {
2449/// "type": "integer",
2450/// "format": "int64"
2451/// },
2452/// "id": {
2453/// "type": "string"
2454/// },
2455/// "object": {
2456/// "type": "string"
2457/// },
2458/// "owned_by": {
2459/// "type": "string"
2460/// },
2461/// "served_by": {
2462/// "$ref": "#/definitions/Provider"
2463/// }
2464/// }
2465///}
2466/// ```
2467/// </details>
2468#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2469pub struct Model {
2470 pub created: i64,
2471 pub id: ::std::string::String,
2472 pub object: ::std::string::String,
2473 pub owned_by: ::std::string::String,
2474 pub served_by: Provider,
2475}
2476///`Provider`
2477///
2478/// <details><summary>JSON schema</summary>
2479///
2480/// ```json
2481///{
2482/// "type": "string",
2483/// "enum": [
2484/// "ollama",
2485/// "ollama_cloud",
2486/// "groq",
2487/// "llamacpp",
2488/// "openai",
2489/// "cloudflare",
2490/// "cohere",
2491/// "anthropic",
2492/// "deepseek",
2493/// "google",
2494/// "mistral",
2495/// "minimax",
2496/// "moonshot",
2497/// "nvidia",
2498/// "zai"
2499/// ]
2500///}
2501/// ```
2502/// </details>
2503#[derive(
2504 ::serde::Deserialize,
2505 ::serde::Serialize,
2506 Clone,
2507 Copy,
2508 Debug,
2509 Eq,
2510 Hash,
2511 Ord,
2512 PartialEq,
2513 PartialOrd,
2514)]
2515pub enum Provider {
2516 #[serde(rename = "ollama")]
2517 Ollama,
2518 #[serde(rename = "ollama_cloud")]
2519 OllamaCloud,
2520 #[serde(rename = "groq")]
2521 Groq,
2522 #[serde(rename = "llamacpp")]
2523 Llamacpp,
2524 #[serde(rename = "openai")]
2525 Openai,
2526 #[serde(rename = "cloudflare")]
2527 Cloudflare,
2528 #[serde(rename = "cohere")]
2529 Cohere,
2530 #[serde(rename = "anthropic")]
2531 Anthropic,
2532 #[serde(rename = "deepseek")]
2533 Deepseek,
2534 #[serde(rename = "google")]
2535 Google,
2536 #[serde(rename = "mistral")]
2537 Mistral,
2538 #[serde(rename = "minimax")]
2539 Minimax,
2540 #[serde(rename = "moonshot")]
2541 Moonshot,
2542 #[serde(rename = "nvidia")]
2543 Nvidia,
2544 #[serde(rename = "zai")]
2545 Zai,
2546}
2547impl ::std::fmt::Display for Provider {
2548 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2549 match *self {
2550 Self::Ollama => f.write_str("ollama"),
2551 Self::OllamaCloud => f.write_str("ollama_cloud"),
2552 Self::Groq => f.write_str("groq"),
2553 Self::Llamacpp => f.write_str("llamacpp"),
2554 Self::Openai => f.write_str("openai"),
2555 Self::Cloudflare => f.write_str("cloudflare"),
2556 Self::Cohere => f.write_str("cohere"),
2557 Self::Anthropic => f.write_str("anthropic"),
2558 Self::Deepseek => f.write_str("deepseek"),
2559 Self::Google => f.write_str("google"),
2560 Self::Mistral => f.write_str("mistral"),
2561 Self::Minimax => f.write_str("minimax"),
2562 Self::Moonshot => f.write_str("moonshot"),
2563 Self::Nvidia => f.write_str("nvidia"),
2564 Self::Zai => f.write_str("zai"),
2565 }
2566 }
2567}
2568impl ::std::str::FromStr for Provider {
2569 type Err = self::error::ConversionError;
2570 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2571 match value {
2572 "ollama" => Ok(Self::Ollama),
2573 "ollama_cloud" => Ok(Self::OllamaCloud),
2574 "groq" => Ok(Self::Groq),
2575 "llamacpp" => Ok(Self::Llamacpp),
2576 "openai" => Ok(Self::Openai),
2577 "cloudflare" => Ok(Self::Cloudflare),
2578 "cohere" => Ok(Self::Cohere),
2579 "anthropic" => Ok(Self::Anthropic),
2580 "deepseek" => Ok(Self::Deepseek),
2581 "google" => Ok(Self::Google),
2582 "mistral" => Ok(Self::Mistral),
2583 "minimax" => Ok(Self::Minimax),
2584 "moonshot" => Ok(Self::Moonshot),
2585 "nvidia" => Ok(Self::Nvidia),
2586 "zai" => Ok(Self::Zai),
2587 _ => Err("invalid value".into()),
2588 }
2589 }
2590}
2591impl ::std::convert::TryFrom<&str> for Provider {
2592 type Error = self::error::ConversionError;
2593 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2594 value.parse()
2595 }
2596}
2597impl ::std::convert::TryFrom<&::std::string::String> for Provider {
2598 type Error = self::error::ConversionError;
2599 fn try_from(
2600 value: &::std::string::String,
2601 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2602 value.parse()
2603 }
2604}
2605impl ::std::convert::TryFrom<::std::string::String> for Provider {
2606 type Error = self::error::ConversionError;
2607 fn try_from(
2608 value: ::std::string::String,
2609 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2610 value.parse()
2611 }
2612}
2613///Authentication type for providers
2614///
2615/// <details><summary>JSON schema</summary>
2616///
2617/// ```json
2618///{
2619/// "description": "Authentication type for providers",
2620/// "type": "string",
2621/// "enum": [
2622/// "bearer",
2623/// "xheader",
2624/// "query",
2625/// "none"
2626/// ]
2627///}
2628/// ```
2629/// </details>
2630#[derive(
2631 ::serde::Deserialize,
2632 ::serde::Serialize,
2633 Clone,
2634 Copy,
2635 Debug,
2636 Eq,
2637 Hash,
2638 Ord,
2639 PartialEq,
2640 PartialOrd,
2641)]
2642pub enum ProviderAuthType {
2643 #[serde(rename = "bearer")]
2644 Bearer,
2645 #[serde(rename = "xheader")]
2646 Xheader,
2647 #[serde(rename = "query")]
2648 Query,
2649 #[serde(rename = "none")]
2650 None,
2651}
2652impl ::std::fmt::Display for ProviderAuthType {
2653 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2654 match *self {
2655 Self::Bearer => f.write_str("bearer"),
2656 Self::Xheader => f.write_str("xheader"),
2657 Self::Query => f.write_str("query"),
2658 Self::None => f.write_str("none"),
2659 }
2660 }
2661}
2662impl ::std::str::FromStr for ProviderAuthType {
2663 type Err = self::error::ConversionError;
2664 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2665 match value {
2666 "bearer" => Ok(Self::Bearer),
2667 "xheader" => Ok(Self::Xheader),
2668 "query" => Ok(Self::Query),
2669 "none" => Ok(Self::None),
2670 _ => Err("invalid value".into()),
2671 }
2672 }
2673}
2674impl ::std::convert::TryFrom<&str> for ProviderAuthType {
2675 type Error = self::error::ConversionError;
2676 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2677 value.parse()
2678 }
2679}
2680impl ::std::convert::TryFrom<&::std::string::String> for ProviderAuthType {
2681 type Error = self::error::ConversionError;
2682 fn try_from(
2683 value: &::std::string::String,
2684 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2685 value.parse()
2686 }
2687}
2688impl ::std::convert::TryFrom<::std::string::String> for ProviderAuthType {
2689 type Error = self::error::ConversionError;
2690 fn try_from(
2691 value: ::std::string::String,
2692 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2693 value.parse()
2694 }
2695}
2696/**Provider-specific response format. Examples:
2697
2698OpenAI GET /v1/models?provider=openai response:
2699```json
2700{
2701 "provider": "openai",
2702 "object": "list",
2703 "data": [
2704 {
2705 "id": "gpt-4",
2706 "object": "model",
2707 "created": 1687882410,
2708 "owned_by": "openai",
2709 "served_by": "openai"
2710 }
2711 ]
2712}
2713```
2714
2715Anthropic GET /v1/models?provider=anthropic response:
2716```json
2717{
2718 "provider": "anthropic",
2719 "object": "list",
2720 "data": [
2721 {
2722 "id": "gpt-4",
2723 "object": "model",
2724 "created": 1687882410,
2725 "owned_by": "openai",
2726 "served_by": "openai"
2727 }
2728 ]
2729}
2730```
2731*/
2732///
2733/// <details><summary>JSON schema</summary>
2734///
2735/// ```json
2736///{
2737/// "description": "Provider-specific response format. Examples:\n\nOpenAI GET /v1/models?provider=openai response:\n```json\n{\n \"provider\": \"openai\",\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"gpt-4\",\n \"object\": \"model\",\n \"created\": 1687882410,\n \"owned_by\": \"openai\",\n \"served_by\": \"openai\"\n }\n ]\n}\n```\n\nAnthropic GET /v1/models?provider=anthropic response:\n```json\n{\n \"provider\": \"anthropic\",\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"gpt-4\",\n \"object\": \"model\",\n \"created\": 1687882410,\n \"owned_by\": \"openai\",\n \"served_by\": \"openai\"\n }\n ]\n}\n```\n",
2738/// "type": "object"
2739///}
2740/// ```
2741/// </details>
2742#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2743#[serde(transparent)]
2744pub struct ProviderSpecificResponse(
2745 pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
2746);
2747impl ::std::ops::Deref for ProviderSpecificResponse {
2748 type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
2749 fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
2750 &self.0
2751 }
2752}
2753impl ::std::convert::From<ProviderSpecificResponse>
2754 for ::serde_json::Map<::std::string::String, ::serde_json::Value>
2755{
2756 fn from(value: ProviderSpecificResponse) -> Self {
2757 value.0
2758 }
2759}
2760impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
2761 for ProviderSpecificResponse
2762{
2763 fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
2764 Self(value)
2765 }
2766}
2767///Represents a model response returned by the Responses API.
2768///
2769/// <details><summary>JSON schema</summary>
2770///
2771/// ```json
2772///{
2773/// "description": "Represents a model response returned by the Responses API.",
2774/// "type": "object",
2775/// "required": [
2776/// "created_at",
2777/// "id",
2778/// "model",
2779/// "object",
2780/// "output",
2781/// "status"
2782/// ],
2783/// "properties": {
2784/// "created_at": {
2785/// "description": "Unix timestamp (in seconds) of when the response was created.",
2786/// "type": "integer",
2787/// "format": "int64"
2788/// },
2789/// "error": {
2790/// "$ref": "#/definitions/ResponseError"
2791/// },
2792/// "id": {
2793/// "description": "Unique identifier for this response.",
2794/// "type": "string"
2795/// },
2796/// "incomplete_details": {
2797/// "$ref": "#/definitions/ResponseIncompleteDetails"
2798/// },
2799/// "instructions": {
2800/// "description": "The system/developer message used to generate the response.",
2801/// "type": "string",
2802/// "nullable": true
2803/// },
2804/// "max_output_tokens": {
2805/// "description": "An upper bound for the number of generated tokens.",
2806/// "type": "integer",
2807/// "nullable": true
2808/// },
2809/// "metadata": {
2810/// "type": "object",
2811/// "additionalProperties": {
2812/// "type": "string"
2813/// }
2814/// },
2815/// "model": {
2816/// "description": "The model used to generate the response.",
2817/// "type": "string"
2818/// },
2819/// "object": {
2820/// "description": "The object type, which is always `response`.",
2821/// "type": "string"
2822/// },
2823/// "output": {
2824/// "description": "An array of content items generated by the model.",
2825/// "type": "array",
2826/// "items": {
2827/// "$ref": "#/definitions/ResponseOutputItem"
2828/// }
2829/// },
2830/// "previous_response_id": {
2831/// "description": "The unique ID of the previous response, if any.",
2832/// "type": "string",
2833/// "nullable": true
2834/// },
2835/// "reasoning": {
2836/// "$ref": "#/definitions/ResponseReasoning"
2837/// },
2838/// "status": {
2839/// "$ref": "#/definitions/ResponseStatus"
2840/// },
2841/// "temperature": {
2842/// "type": "number",
2843/// "format": "float",
2844/// "nullable": true
2845/// },
2846/// "text": {
2847/// "$ref": "#/definitions/ResponseTextConfig"
2848/// },
2849/// "tool_choice": {
2850/// "$ref": "#/definitions/ResponseToolChoice"
2851/// },
2852/// "tools": {
2853/// "type": "array",
2854/// "items": {
2855/// "$ref": "#/definitions/ResponseTool"
2856/// }
2857/// },
2858/// "top_p": {
2859/// "type": "number",
2860/// "format": "float",
2861/// "nullable": true
2862/// },
2863/// "usage": {
2864/// "$ref": "#/definitions/ResponseUsage"
2865/// }
2866/// }
2867///}
2868/// ```
2869/// </details>
2870#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2871pub struct Response {
2872 ///Unix timestamp (in seconds) of when the response was created.
2873 pub created_at: i64,
2874 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2875 pub error: ::std::option::Option<ResponseError>,
2876 ///Unique identifier for this response.
2877 pub id: ::std::string::String,
2878 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2879 pub incomplete_details: ::std::option::Option<ResponseIncompleteDetails>,
2880 ///The system/developer message used to generate the response.
2881 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2882 pub instructions: ::std::option::Option<::std::string::String>,
2883 ///An upper bound for the number of generated tokens.
2884 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2885 pub max_output_tokens: ::std::option::Option<i64>,
2886 #[serde(
2887 default,
2888 skip_serializing_if = ":: std :: collections :: HashMap::is_empty"
2889 )]
2890 pub metadata: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
2891 ///The model used to generate the response.
2892 pub model: ::std::string::String,
2893 ///The object type, which is always `response`.
2894 pub object: ::std::string::String,
2895 ///An array of content items generated by the model.
2896 pub output: ::std::vec::Vec<ResponseOutputItem>,
2897 ///The unique ID of the previous response, if any.
2898 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2899 pub previous_response_id: ::std::option::Option<::std::string::String>,
2900 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2901 pub reasoning: ::std::option::Option<ResponseReasoning>,
2902 pub status: ResponseStatus,
2903 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2904 pub temperature: ::std::option::Option<f32>,
2905 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2906 pub text: ::std::option::Option<ResponseTextConfig>,
2907 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2908 pub tool_choice: ::std::option::Option<ResponseToolChoice>,
2909 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
2910 pub tools: ::std::vec::Vec<ResponseTool>,
2911 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2912 pub top_p: ::std::option::Option<f32>,
2913 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2914 pub usage: ::std::option::Option<ResponseUsage>,
2915}
2916///An error object returned when the model fails to generate a response.
2917///
2918/// <details><summary>JSON schema</summary>
2919///
2920/// ```json
2921///{
2922/// "description": "An error object returned when the model fails to generate a response.",
2923/// "type": "object",
2924/// "required": [
2925/// "code",
2926/// "message"
2927/// ],
2928/// "properties": {
2929/// "code": {
2930/// "description": "The error code for the response.",
2931/// "type": "string"
2932/// },
2933/// "message": {
2934/// "description": "A human-readable description of the error.",
2935/// "type": "string"
2936/// }
2937/// },
2938/// "nullable": true
2939///}
2940/// ```
2941/// </details>
2942#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2943pub struct ResponseError {
2944 ///The error code for the response.
2945 pub code: ::std::string::String,
2946 ///A human-readable description of the error.
2947 pub message: ::std::string::String,
2948}
2949/**JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
2950*/
2951///
2952/// <details><summary>JSON schema</summary>
2953///
2954/// ```json
2955///{
2956/// "description": "JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.\n",
2957/// "type": "object",
2958/// "required": [
2959/// "type"
2960/// ],
2961/// "properties": {
2962/// "type": {
2963/// "description": "The type of response format being defined. Always `json_object`.",
2964/// "type": "string",
2965/// "enum": [
2966/// "json_object"
2967/// ]
2968/// }
2969/// }
2970///}
2971/// ```
2972/// </details>
2973#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2974pub struct ResponseFormatJsonObject {
2975 ///The type of response format being defined. Always `json_object`.
2976 #[serde(rename = "type")]
2977 pub type_: ResponseFormatJsonObjectType,
2978}
2979///The type of response format being defined. Always `json_object`.
2980///
2981/// <details><summary>JSON schema</summary>
2982///
2983/// ```json
2984///{
2985/// "description": "The type of response format being defined. Always `json_object`.",
2986/// "type": "string",
2987/// "enum": [
2988/// "json_object"
2989/// ]
2990///}
2991/// ```
2992/// </details>
2993#[derive(
2994 ::serde::Deserialize,
2995 ::serde::Serialize,
2996 Clone,
2997 Copy,
2998 Debug,
2999 Eq,
3000 Hash,
3001 Ord,
3002 PartialEq,
3003 PartialOrd,
3004)]
3005pub enum ResponseFormatJsonObjectType {
3006 #[serde(rename = "json_object")]
3007 JsonObject,
3008}
3009impl ::std::fmt::Display for ResponseFormatJsonObjectType {
3010 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3011 match *self {
3012 Self::JsonObject => f.write_str("json_object"),
3013 }
3014 }
3015}
3016impl ::std::str::FromStr for ResponseFormatJsonObjectType {
3017 type Err = self::error::ConversionError;
3018 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3019 match value {
3020 "json_object" => Ok(Self::JsonObject),
3021 _ => Err("invalid value".into()),
3022 }
3023 }
3024}
3025impl ::std::convert::TryFrom<&str> for ResponseFormatJsonObjectType {
3026 type Error = self::error::ConversionError;
3027 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3028 value.parse()
3029 }
3030}
3031impl ::std::convert::TryFrom<&::std::string::String> for ResponseFormatJsonObjectType {
3032 type Error = self::error::ConversionError;
3033 fn try_from(
3034 value: &::std::string::String,
3035 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3036 value.parse()
3037 }
3038}
3039impl ::std::convert::TryFrom<::std::string::String> for ResponseFormatJsonObjectType {
3040 type Error = self::error::ConversionError;
3041 fn try_from(
3042 value: ::std::string::String,
3043 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3044 value.parse()
3045 }
3046}
3047/**JSON Schema response format. Used to generate structured JSON responses.
3048*/
3049///
3050/// <details><summary>JSON schema</summary>
3051///
3052/// ```json
3053///{
3054/// "description": "JSON Schema response format. Used to generate structured JSON responses.\n",
3055/// "type": "object",
3056/// "required": [
3057/// "json_schema",
3058/// "type"
3059/// ],
3060/// "properties": {
3061/// "json_schema": {
3062/// "description": "Structured Outputs configuration options, including a JSON Schema.",
3063/// "type": "object",
3064/// "required": [
3065/// "name"
3066/// ],
3067/// "properties": {
3068/// "description": {
3069/// "description": "A description of what the response format is for, used by the model to determine how to respond in the format.\n",
3070/// "type": "string"
3071/// },
3072/// "name": {
3073/// "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.\n",
3074/// "type": "string"
3075/// },
3076/// "schema": {
3077/// "$ref": "#/definitions/ResponseFormatJsonSchemaSchema"
3078/// },
3079/// "strict": {
3080/// "description": "Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`.\n",
3081/// "default": false,
3082/// "type": "boolean"
3083/// }
3084/// }
3085/// },
3086/// "type": {
3087/// "description": "The type of response format being defined. Always `json_schema`.",
3088/// "type": "string",
3089/// "enum": [
3090/// "json_schema"
3091/// ]
3092/// }
3093/// }
3094///}
3095/// ```
3096/// </details>
3097#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3098pub struct ResponseFormatJsonSchema {
3099 pub json_schema: ResponseFormatJsonSchemaJsonSchema,
3100 ///The type of response format being defined. Always `json_schema`.
3101 #[serde(rename = "type")]
3102 pub type_: ResponseFormatJsonSchemaType,
3103}
3104///Structured Outputs configuration options, including a JSON Schema.
3105///
3106/// <details><summary>JSON schema</summary>
3107///
3108/// ```json
3109///{
3110/// "description": "Structured Outputs configuration options, including a JSON Schema.",
3111/// "type": "object",
3112/// "required": [
3113/// "name"
3114/// ],
3115/// "properties": {
3116/// "description": {
3117/// "description": "A description of what the response format is for, used by the model to determine how to respond in the format.\n",
3118/// "type": "string"
3119/// },
3120/// "name": {
3121/// "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.\n",
3122/// "type": "string"
3123/// },
3124/// "schema": {
3125/// "$ref": "#/definitions/ResponseFormatJsonSchemaSchema"
3126/// },
3127/// "strict": {
3128/// "description": "Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`.\n",
3129/// "default": false,
3130/// "type": "boolean"
3131/// }
3132/// }
3133///}
3134/// ```
3135/// </details>
3136#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3137pub struct ResponseFormatJsonSchemaJsonSchema {
3138 /**A description of what the response format is for, used by the model to determine how to respond in the format.
3139 */
3140 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3141 pub description: ::std::option::Option<::std::string::String>,
3142 /**The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
3143 */
3144 pub name: ::std::string::String,
3145 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3146 pub schema: ::std::option::Option<ResponseFormatJsonSchemaSchema>,
3147 /**Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`.
3148 */
3149 #[serde(default)]
3150 pub strict: bool,
3151}
3152/**The schema for the response format, described as a JSON Schema object.
3153*/
3154///
3155/// <details><summary>JSON schema</summary>
3156///
3157/// ```json
3158///{
3159/// "description": "The schema for the response format, described as a JSON Schema object.\n",
3160/// "type": "object",
3161/// "additionalProperties": true
3162///}
3163/// ```
3164/// </details>
3165#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3166#[serde(transparent)]
3167pub struct ResponseFormatJsonSchemaSchema(
3168 pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3169);
3170impl ::std::ops::Deref for ResponseFormatJsonSchemaSchema {
3171 type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
3172 fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
3173 &self.0
3174 }
3175}
3176impl ::std::convert::From<ResponseFormatJsonSchemaSchema>
3177 for ::serde_json::Map<::std::string::String, ::serde_json::Value>
3178{
3179 fn from(value: ResponseFormatJsonSchemaSchema) -> Self {
3180 value.0
3181 }
3182}
3183impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
3184 for ResponseFormatJsonSchemaSchema
3185{
3186 fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
3187 Self(value)
3188 }
3189}
3190///The type of response format being defined. Always `json_schema`.
3191///
3192/// <details><summary>JSON schema</summary>
3193///
3194/// ```json
3195///{
3196/// "description": "The type of response format being defined. Always `json_schema`.",
3197/// "type": "string",
3198/// "enum": [
3199/// "json_schema"
3200/// ]
3201///}
3202/// ```
3203/// </details>
3204#[derive(
3205 ::serde::Deserialize,
3206 ::serde::Serialize,
3207 Clone,
3208 Copy,
3209 Debug,
3210 Eq,
3211 Hash,
3212 Ord,
3213 PartialEq,
3214 PartialOrd,
3215)]
3216pub enum ResponseFormatJsonSchemaType {
3217 #[serde(rename = "json_schema")]
3218 JsonSchema,
3219}
3220impl ::std::fmt::Display for ResponseFormatJsonSchemaType {
3221 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3222 match *self {
3223 Self::JsonSchema => f.write_str("json_schema"),
3224 }
3225 }
3226}
3227impl ::std::str::FromStr for ResponseFormatJsonSchemaType {
3228 type Err = self::error::ConversionError;
3229 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3230 match value {
3231 "json_schema" => Ok(Self::JsonSchema),
3232 _ => Err("invalid value".into()),
3233 }
3234 }
3235}
3236impl ::std::convert::TryFrom<&str> for ResponseFormatJsonSchemaType {
3237 type Error = self::error::ConversionError;
3238 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3239 value.parse()
3240 }
3241}
3242impl ::std::convert::TryFrom<&::std::string::String> for ResponseFormatJsonSchemaType {
3243 type Error = self::error::ConversionError;
3244 fn try_from(
3245 value: &::std::string::String,
3246 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3247 value.parse()
3248 }
3249}
3250impl ::std::convert::TryFrom<::std::string::String> for ResponseFormatJsonSchemaType {
3251 type Error = self::error::ConversionError;
3252 fn try_from(
3253 value: ::std::string::String,
3254 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3255 value.parse()
3256 }
3257}
3258///Default response format. Used to generate text responses.
3259///
3260/// <details><summary>JSON schema</summary>
3261///
3262/// ```json
3263///{
3264/// "description": "Default response format. Used to generate text responses.",
3265/// "type": "object",
3266/// "required": [
3267/// "type"
3268/// ],
3269/// "properties": {
3270/// "type": {
3271/// "description": "The type of response format being defined. Always `text`.",
3272/// "type": "string",
3273/// "enum": [
3274/// "text"
3275/// ]
3276/// }
3277/// }
3278///}
3279/// ```
3280/// </details>
3281#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3282pub struct ResponseFormatText {
3283 ///The type of response format being defined. Always `text`.
3284 #[serde(rename = "type")]
3285 pub type_: ResponseFormatTextType,
3286}
3287///The type of response format being defined. Always `text`.
3288///
3289/// <details><summary>JSON schema</summary>
3290///
3291/// ```json
3292///{
3293/// "description": "The type of response format being defined. Always `text`.",
3294/// "type": "string",
3295/// "enum": [
3296/// "text"
3297/// ]
3298///}
3299/// ```
3300/// </details>
3301#[derive(
3302 ::serde::Deserialize,
3303 ::serde::Serialize,
3304 Clone,
3305 Copy,
3306 Debug,
3307 Eq,
3308 Hash,
3309 Ord,
3310 PartialEq,
3311 PartialOrd,
3312)]
3313pub enum ResponseFormatTextType {
3314 #[serde(rename = "text")]
3315 Text,
3316}
3317impl ::std::fmt::Display for ResponseFormatTextType {
3318 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3319 match *self {
3320 Self::Text => f.write_str("text"),
3321 }
3322 }
3323}
3324impl ::std::str::FromStr for ResponseFormatTextType {
3325 type Err = self::error::ConversionError;
3326 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3327 match value {
3328 "text" => Ok(Self::Text),
3329 _ => Err("invalid value".into()),
3330 }
3331 }
3332}
3333impl ::std::convert::TryFrom<&str> for ResponseFormatTextType {
3334 type Error = self::error::ConversionError;
3335 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3336 value.parse()
3337 }
3338}
3339impl ::std::convert::TryFrom<&::std::string::String> for ResponseFormatTextType {
3340 type Error = self::error::ConversionError;
3341 fn try_from(
3342 value: &::std::string::String,
3343 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3344 value.parse()
3345 }
3346}
3347impl ::std::convert::TryFrom<::std::string::String> for ResponseFormatTextType {
3348 type Error = self::error::ConversionError;
3349 fn try_from(
3350 value: ::std::string::String,
3351 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3352 value.parse()
3353 }
3354}
3355///A tool call to a function generated by the model.
3356///
3357/// <details><summary>JSON schema</summary>
3358///
3359/// ```json
3360///{
3361/// "description": "A tool call to a function generated by the model.",
3362/// "type": "object",
3363/// "required": [
3364/// "arguments",
3365/// "call_id",
3366/// "name",
3367/// "type"
3368/// ],
3369/// "properties": {
3370/// "arguments": {
3371/// "description": "A JSON string of the arguments to pass to the function.",
3372/// "type": "string"
3373/// },
3374/// "call_id": {
3375/// "description": "The unique ID of the function tool call generated by the model, used to associate the call with its output.\n",
3376/// "type": "string"
3377/// },
3378/// "id": {
3379/// "description": "The unique ID of the function tool call.",
3380/// "type": "string"
3381/// },
3382/// "name": {
3383/// "description": "The name of the function to run.",
3384/// "type": "string"
3385/// },
3386/// "status": {
3387/// "description": "The status of the function tool call.",
3388/// "type": "string",
3389/// "enum": [
3390/// "in_progress",
3391/// "completed",
3392/// "incomplete"
3393/// ]
3394/// },
3395/// "type": {
3396/// "description": "The type of the output item. Always `function_call`.",
3397/// "type": "string",
3398/// "enum": [
3399/// "function_call"
3400/// ]
3401/// }
3402/// }
3403///}
3404/// ```
3405/// </details>
3406#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3407pub struct ResponseFunctionToolCall {
3408 ///A JSON string of the arguments to pass to the function.
3409 pub arguments: ::std::string::String,
3410 /**The unique ID of the function tool call generated by the model, used to associate the call with its output.
3411 */
3412 pub call_id: ::std::string::String,
3413 ///The unique ID of the function tool call.
3414 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3415 pub id: ::std::option::Option<::std::string::String>,
3416 ///The name of the function to run.
3417 pub name: ::std::string::String,
3418 ///The status of the function tool call.
3419 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3420 pub status: ::std::option::Option<ResponseFunctionToolCallStatus>,
3421 ///The type of the output item. Always `function_call`.
3422 #[serde(rename = "type")]
3423 pub type_: ResponseFunctionToolCallType,
3424}
3425///The status of the function tool call.
3426///
3427/// <details><summary>JSON schema</summary>
3428///
3429/// ```json
3430///{
3431/// "description": "The status of the function tool call.",
3432/// "type": "string",
3433/// "enum": [
3434/// "in_progress",
3435/// "completed",
3436/// "incomplete"
3437/// ]
3438///}
3439/// ```
3440/// </details>
3441#[derive(
3442 ::serde::Deserialize,
3443 ::serde::Serialize,
3444 Clone,
3445 Copy,
3446 Debug,
3447 Eq,
3448 Hash,
3449 Ord,
3450 PartialEq,
3451 PartialOrd,
3452)]
3453pub enum ResponseFunctionToolCallStatus {
3454 #[serde(rename = "in_progress")]
3455 InProgress,
3456 #[serde(rename = "completed")]
3457 Completed,
3458 #[serde(rename = "incomplete")]
3459 Incomplete,
3460}
3461impl ::std::fmt::Display for ResponseFunctionToolCallStatus {
3462 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3463 match *self {
3464 Self::InProgress => f.write_str("in_progress"),
3465 Self::Completed => f.write_str("completed"),
3466 Self::Incomplete => f.write_str("incomplete"),
3467 }
3468 }
3469}
3470impl ::std::str::FromStr for ResponseFunctionToolCallStatus {
3471 type Err = self::error::ConversionError;
3472 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3473 match value {
3474 "in_progress" => Ok(Self::InProgress),
3475 "completed" => Ok(Self::Completed),
3476 "incomplete" => Ok(Self::Incomplete),
3477 _ => Err("invalid value".into()),
3478 }
3479 }
3480}
3481impl ::std::convert::TryFrom<&str> for ResponseFunctionToolCallStatus {
3482 type Error = self::error::ConversionError;
3483 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3484 value.parse()
3485 }
3486}
3487impl ::std::convert::TryFrom<&::std::string::String> for ResponseFunctionToolCallStatus {
3488 type Error = self::error::ConversionError;
3489 fn try_from(
3490 value: &::std::string::String,
3491 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3492 value.parse()
3493 }
3494}
3495impl ::std::convert::TryFrom<::std::string::String> for ResponseFunctionToolCallStatus {
3496 type Error = self::error::ConversionError;
3497 fn try_from(
3498 value: ::std::string::String,
3499 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3500 value.parse()
3501 }
3502}
3503///The type of the output item. Always `function_call`.
3504///
3505/// <details><summary>JSON schema</summary>
3506///
3507/// ```json
3508///{
3509/// "description": "The type of the output item. Always `function_call`.",
3510/// "type": "string",
3511/// "enum": [
3512/// "function_call"
3513/// ]
3514///}
3515/// ```
3516/// </details>
3517#[derive(
3518 ::serde::Deserialize,
3519 ::serde::Serialize,
3520 Clone,
3521 Copy,
3522 Debug,
3523 Eq,
3524 Hash,
3525 Ord,
3526 PartialEq,
3527 PartialOrd,
3528)]
3529pub enum ResponseFunctionToolCallType {
3530 #[serde(rename = "function_call")]
3531 FunctionCall,
3532}
3533impl ::std::fmt::Display for ResponseFunctionToolCallType {
3534 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3535 match *self {
3536 Self::FunctionCall => f.write_str("function_call"),
3537 }
3538 }
3539}
3540impl ::std::str::FromStr for ResponseFunctionToolCallType {
3541 type Err = self::error::ConversionError;
3542 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3543 match value {
3544 "function_call" => Ok(Self::FunctionCall),
3545 _ => Err("invalid value".into()),
3546 }
3547 }
3548}
3549impl ::std::convert::TryFrom<&str> for ResponseFunctionToolCallType {
3550 type Error = self::error::ConversionError;
3551 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3552 value.parse()
3553 }
3554}
3555impl ::std::convert::TryFrom<&::std::string::String> for ResponseFunctionToolCallType {
3556 type Error = self::error::ConversionError;
3557 fn try_from(
3558 value: &::std::string::String,
3559 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3560 value.parse()
3561 }
3562}
3563impl ::std::convert::TryFrom<::std::string::String> for ResponseFunctionToolCallType {
3564 type Error = self::error::ConversionError;
3565 fn try_from(
3566 value: ::std::string::String,
3567 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3568 value.parse()
3569 }
3570}
3571///Details about why the response is incomplete.
3572///
3573/// <details><summary>JSON schema</summary>
3574///
3575/// ```json
3576///{
3577/// "description": "Details about why the response is incomplete.",
3578/// "type": "object",
3579/// "properties": {
3580/// "reason": {
3581/// "description": "The reason why the response is incomplete.",
3582/// "type": "string"
3583/// }
3584/// },
3585/// "nullable": true
3586///}
3587/// ```
3588/// </details>
3589#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3590pub struct ResponseIncompleteDetails {
3591 ///The reason why the response is incomplete.
3592 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3593 pub reason: ::std::option::Option<::std::string::String>,
3594}
3595impl ::std::default::Default for ResponseIncompleteDetails {
3596 fn default() -> Self {
3597 Self {
3598 reason: Default::default(),
3599 }
3600 }
3601}
3602/**Text, image, or file inputs to the model. Either a single text prompt or a list of input items representing a (possibly batched) conversation.
3603*/
3604///
3605/// <details><summary>JSON schema</summary>
3606///
3607/// ```json
3608///{
3609/// "description": "Text, image, or file inputs to the model. Either a single text prompt or a list of input items representing a (possibly batched) conversation.\n",
3610/// "oneOf": [
3611/// {
3612/// "description": "A text input to the model, equivalent to a user message.",
3613/// "type": "string"
3614/// },
3615/// {
3616/// "description": "A list of input items.",
3617/// "type": "array",
3618/// "items": {
3619/// "$ref": "#/definitions/ResponseInputItem"
3620/// }
3621/// }
3622/// ]
3623///}
3624/// ```
3625/// </details>
3626#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3627#[serde(untagged)]
3628pub enum ResponseInput {
3629 String(::std::string::String),
3630 Array(::std::vec::Vec<ResponseInputItem>),
3631}
3632impl ::std::convert::From<::std::vec::Vec<ResponseInputItem>> for ResponseInput {
3633 fn from(value: ::std::vec::Vec<ResponseInputItem>) -> Self {
3634 Self::Array(value)
3635 }
3636}
3637///A content part within an input message.
3638///
3639/// <details><summary>JSON schema</summary>
3640///
3641/// ```json
3642///{
3643/// "description": "A content part within an input message.",
3644/// "type": "object",
3645/// "oneOf": [
3646/// {
3647/// "$ref": "#/definitions/ResponseInputText"
3648/// },
3649/// {
3650/// "$ref": "#/definitions/ResponseInputImage"
3651/// }
3652/// ]
3653///}
3654/// ```
3655/// </details>
3656#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3657#[serde(untagged)]
3658pub enum ResponseInputContentPart {
3659 Text(ResponseInputText),
3660 Image(ResponseInputImage),
3661}
3662impl ::std::convert::From<ResponseInputText> for ResponseInputContentPart {
3663 fn from(value: ResponseInputText) -> Self {
3664 Self::Text(value)
3665 }
3666}
3667impl ::std::convert::From<ResponseInputImage> for ResponseInputContentPart {
3668 fn from(value: ResponseInputImage) -> Self {
3669 Self::Image(value)
3670 }
3671}
3672///An image input to the model.
3673///
3674/// <details><summary>JSON schema</summary>
3675///
3676/// ```json
3677///{
3678/// "description": "An image input to the model.",
3679/// "type": "object",
3680/// "required": [
3681/// "type"
3682/// ],
3683/// "properties": {
3684/// "detail": {
3685/// "description": "The detail level of the image to send to the model.",
3686/// "default": "auto",
3687/// "type": "string",
3688/// "enum": [
3689/// "auto",
3690/// "low",
3691/// "high"
3692/// ]
3693/// },
3694/// "image_url": {
3695/// "description": "The URL of the image (data URLs supported).",
3696/// "type": "string"
3697/// },
3698/// "type": {
3699/// "description": "The type of the input item. Always `input_image`.",
3700/// "type": "string",
3701/// "enum": [
3702/// "input_image"
3703/// ]
3704/// }
3705/// }
3706///}
3707/// ```
3708/// </details>
3709#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3710pub struct ResponseInputImage {
3711 ///The detail level of the image to send to the model.
3712 #[serde(default = "defaults::response_input_image_detail")]
3713 pub detail: ResponseInputImageDetail,
3714 ///The URL of the image (data URLs supported).
3715 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3716 pub image_url: ::std::option::Option<::std::string::String>,
3717 ///The type of the input item. Always `input_image`.
3718 #[serde(rename = "type")]
3719 pub type_: ResponseInputImageType,
3720}
3721///The detail level of the image to send to the model.
3722///
3723/// <details><summary>JSON schema</summary>
3724///
3725/// ```json
3726///{
3727/// "description": "The detail level of the image to send to the model.",
3728/// "default": "auto",
3729/// "type": "string",
3730/// "enum": [
3731/// "auto",
3732/// "low",
3733/// "high"
3734/// ]
3735///}
3736/// ```
3737/// </details>
3738#[derive(
3739 ::serde::Deserialize,
3740 ::serde::Serialize,
3741 Clone,
3742 Copy,
3743 Debug,
3744 Eq,
3745 Hash,
3746 Ord,
3747 PartialEq,
3748 PartialOrd,
3749)]
3750pub enum ResponseInputImageDetail {
3751 #[serde(rename = "auto")]
3752 Auto,
3753 #[serde(rename = "low")]
3754 Low,
3755 #[serde(rename = "high")]
3756 High,
3757}
3758impl ::std::fmt::Display for ResponseInputImageDetail {
3759 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3760 match *self {
3761 Self::Auto => f.write_str("auto"),
3762 Self::Low => f.write_str("low"),
3763 Self::High => f.write_str("high"),
3764 }
3765 }
3766}
3767impl ::std::str::FromStr for ResponseInputImageDetail {
3768 type Err = self::error::ConversionError;
3769 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3770 match value {
3771 "auto" => Ok(Self::Auto),
3772 "low" => Ok(Self::Low),
3773 "high" => Ok(Self::High),
3774 _ => Err("invalid value".into()),
3775 }
3776 }
3777}
3778impl ::std::convert::TryFrom<&str> for ResponseInputImageDetail {
3779 type Error = self::error::ConversionError;
3780 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3781 value.parse()
3782 }
3783}
3784impl ::std::convert::TryFrom<&::std::string::String> for ResponseInputImageDetail {
3785 type Error = self::error::ConversionError;
3786 fn try_from(
3787 value: &::std::string::String,
3788 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3789 value.parse()
3790 }
3791}
3792impl ::std::convert::TryFrom<::std::string::String> for ResponseInputImageDetail {
3793 type Error = self::error::ConversionError;
3794 fn try_from(
3795 value: ::std::string::String,
3796 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3797 value.parse()
3798 }
3799}
3800impl ::std::default::Default for ResponseInputImageDetail {
3801 fn default() -> Self {
3802 ResponseInputImageDetail::Auto
3803 }
3804}
3805///The type of the input item. Always `input_image`.
3806///
3807/// <details><summary>JSON schema</summary>
3808///
3809/// ```json
3810///{
3811/// "description": "The type of the input item. Always `input_image`.",
3812/// "type": "string",
3813/// "enum": [
3814/// "input_image"
3815/// ]
3816///}
3817/// ```
3818/// </details>
3819#[derive(
3820 ::serde::Deserialize,
3821 ::serde::Serialize,
3822 Clone,
3823 Copy,
3824 Debug,
3825 Eq,
3826 Hash,
3827 Ord,
3828 PartialEq,
3829 PartialOrd,
3830)]
3831pub enum ResponseInputImageType {
3832 #[serde(rename = "input_image")]
3833 InputImage,
3834}
3835impl ::std::fmt::Display for ResponseInputImageType {
3836 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3837 match *self {
3838 Self::InputImage => f.write_str("input_image"),
3839 }
3840 }
3841}
3842impl ::std::str::FromStr for ResponseInputImageType {
3843 type Err = self::error::ConversionError;
3844 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3845 match value {
3846 "input_image" => Ok(Self::InputImage),
3847 _ => Err("invalid value".into()),
3848 }
3849 }
3850}
3851impl ::std::convert::TryFrom<&str> for ResponseInputImageType {
3852 type Error = self::error::ConversionError;
3853 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3854 value.parse()
3855 }
3856}
3857impl ::std::convert::TryFrom<&::std::string::String> for ResponseInputImageType {
3858 type Error = self::error::ConversionError;
3859 fn try_from(
3860 value: &::std::string::String,
3861 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3862 value.parse()
3863 }
3864}
3865impl ::std::convert::TryFrom<::std::string::String> for ResponseInputImageType {
3866 type Error = self::error::ConversionError;
3867 fn try_from(
3868 value: ::std::string::String,
3869 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3870 value.parse()
3871 }
3872}
3873/**A single input item. Most commonly an input message with a role and content.
3874*/
3875///
3876/// <details><summary>JSON schema</summary>
3877///
3878/// ```json
3879///{
3880/// "description": "A single input item. Most commonly an input message with a role and content.\n",
3881/// "type": "object",
3882/// "required": [
3883/// "content",
3884/// "role"
3885/// ],
3886/// "properties": {
3887/// "content": {
3888/// "$ref": "#/definitions/ResponseInputMessageContent"
3889/// },
3890/// "role": {
3891/// "$ref": "#/definitions/ResponseRole"
3892/// },
3893/// "type": {
3894/// "description": "The type of the input item. Defaults to `message`.",
3895/// "default": "message",
3896/// "type": "string"
3897/// }
3898/// }
3899///}
3900/// ```
3901/// </details>
3902#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3903pub struct ResponseInputItem {
3904 pub content: ResponseInputMessageContent,
3905 pub role: ResponseRole,
3906 ///The type of the input item. Defaults to `message`.
3907 #[serde(rename = "type", default = "defaults::response_input_item_type")]
3908 pub type_: ::std::string::String,
3909}
3910/**Text or multimodal content for an input message. Either a string or a list of content parts.
3911*/
3912///
3913/// <details><summary>JSON schema</summary>
3914///
3915/// ```json
3916///{
3917/// "description": "Text or multimodal content for an input message. Either a string or a list of content parts.\n",
3918/// "oneOf": [
3919/// {
3920/// "description": "A text input to the model.",
3921/// "type": "string"
3922/// },
3923/// {
3924/// "type": "array",
3925/// "items": {
3926/// "$ref": "#/definitions/ResponseInputContentPart"
3927/// }
3928/// }
3929/// ]
3930///}
3931/// ```
3932/// </details>
3933#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3934#[serde(untagged)]
3935pub enum ResponseInputMessageContent {
3936 String(::std::string::String),
3937 Array(::std::vec::Vec<ResponseInputContentPart>),
3938}
3939impl ::std::convert::From<::std::vec::Vec<ResponseInputContentPart>>
3940 for ResponseInputMessageContent
3941{
3942 fn from(value: ::std::vec::Vec<ResponseInputContentPart>) -> Self {
3943 Self::Array(value)
3944 }
3945}
3946///A text input to the model.
3947///
3948/// <details><summary>JSON schema</summary>
3949///
3950/// ```json
3951///{
3952/// "description": "A text input to the model.",
3953/// "type": "object",
3954/// "required": [
3955/// "text",
3956/// "type"
3957/// ],
3958/// "properties": {
3959/// "text": {
3960/// "description": "The text input to the model.",
3961/// "type": "string"
3962/// },
3963/// "type": {
3964/// "description": "The type of the input item. Always `input_text`.",
3965/// "type": "string",
3966/// "enum": [
3967/// "input_text"
3968/// ]
3969/// }
3970/// }
3971///}
3972/// ```
3973/// </details>
3974#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3975pub struct ResponseInputText {
3976 ///The text input to the model.
3977 pub text: ::std::string::String,
3978 ///The type of the input item. Always `input_text`.
3979 #[serde(rename = "type")]
3980 pub type_: ResponseInputTextType,
3981}
3982///The type of the input item. Always `input_text`.
3983///
3984/// <details><summary>JSON schema</summary>
3985///
3986/// ```json
3987///{
3988/// "description": "The type of the input item. Always `input_text`.",
3989/// "type": "string",
3990/// "enum": [
3991/// "input_text"
3992/// ]
3993///}
3994/// ```
3995/// </details>
3996#[derive(
3997 ::serde::Deserialize,
3998 ::serde::Serialize,
3999 Clone,
4000 Copy,
4001 Debug,
4002 Eq,
4003 Hash,
4004 Ord,
4005 PartialEq,
4006 PartialOrd,
4007)]
4008pub enum ResponseInputTextType {
4009 #[serde(rename = "input_text")]
4010 InputText,
4011}
4012impl ::std::fmt::Display for ResponseInputTextType {
4013 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4014 match *self {
4015 Self::InputText => f.write_str("input_text"),
4016 }
4017 }
4018}
4019impl ::std::str::FromStr for ResponseInputTextType {
4020 type Err = self::error::ConversionError;
4021 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4022 match value {
4023 "input_text" => Ok(Self::InputText),
4024 _ => Err("invalid value".into()),
4025 }
4026 }
4027}
4028impl ::std::convert::TryFrom<&str> for ResponseInputTextType {
4029 type Error = self::error::ConversionError;
4030 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4031 value.parse()
4032 }
4033}
4034impl ::std::convert::TryFrom<&::std::string::String> for ResponseInputTextType {
4035 type Error = self::error::ConversionError;
4036 fn try_from(
4037 value: &::std::string::String,
4038 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4039 value.parse()
4040 }
4041}
4042impl ::std::convert::TryFrom<::std::string::String> for ResponseInputTextType {
4043 type Error = self::error::ConversionError;
4044 fn try_from(
4045 value: ::std::string::String,
4046 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4047 value.parse()
4048 }
4049}
4050///A content part of an output message.
4051///
4052/// <details><summary>JSON schema</summary>
4053///
4054/// ```json
4055///{
4056/// "description": "A content part of an output message.",
4057/// "type": "object",
4058/// "oneOf": [
4059/// {
4060/// "$ref": "#/definitions/ResponseOutputText"
4061/// },
4062/// {
4063/// "$ref": "#/definitions/ResponseOutputRefusal"
4064/// }
4065/// ]
4066///}
4067/// ```
4068/// </details>
4069#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4070#[serde(untagged)]
4071pub enum ResponseOutputContent {
4072 Text(ResponseOutputText),
4073 Refusal(ResponseOutputRefusal),
4074}
4075impl ::std::convert::From<ResponseOutputText> for ResponseOutputContent {
4076 fn from(value: ResponseOutputText) -> Self {
4077 Self::Text(value)
4078 }
4079}
4080impl ::std::convert::From<ResponseOutputRefusal> for ResponseOutputContent {
4081 fn from(value: ResponseOutputRefusal) -> Self {
4082 Self::Refusal(value)
4083 }
4084}
4085/**An output item generated by the model: an output message, a function tool call, or a reasoning item.
4086*/
4087///
4088/// <details><summary>JSON schema</summary>
4089///
4090/// ```json
4091///{
4092/// "description": "An output item generated by the model: an output message, a function tool call, or a reasoning item.\n",
4093/// "type": "object",
4094/// "oneOf": [
4095/// {
4096/// "$ref": "#/definitions/ResponseOutputMessage"
4097/// },
4098/// {
4099/// "$ref": "#/definitions/ResponseFunctionToolCall"
4100/// },
4101/// {
4102/// "$ref": "#/definitions/ResponseReasoningItem"
4103/// }
4104/// ]
4105///}
4106/// ```
4107/// </details>
4108#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4109#[serde(untagged)]
4110pub enum ResponseOutputItem {
4111 OutputMessage(ResponseOutputMessage),
4112 FunctionToolCall(ResponseFunctionToolCall),
4113 ReasoningItem(ResponseReasoningItem),
4114}
4115impl ::std::convert::From<ResponseOutputMessage> for ResponseOutputItem {
4116 fn from(value: ResponseOutputMessage) -> Self {
4117 Self::OutputMessage(value)
4118 }
4119}
4120impl ::std::convert::From<ResponseFunctionToolCall> for ResponseOutputItem {
4121 fn from(value: ResponseFunctionToolCall) -> Self {
4122 Self::FunctionToolCall(value)
4123 }
4124}
4125impl ::std::convert::From<ResponseReasoningItem> for ResponseOutputItem {
4126 fn from(value: ResponseReasoningItem) -> Self {
4127 Self::ReasoningItem(value)
4128 }
4129}
4130///An output message from the model.
4131///
4132/// <details><summary>JSON schema</summary>
4133///
4134/// ```json
4135///{
4136/// "description": "An output message from the model.",
4137/// "type": "object",
4138/// "required": [
4139/// "content",
4140/// "id",
4141/// "role",
4142/// "type"
4143/// ],
4144/// "properties": {
4145/// "content": {
4146/// "type": "array",
4147/// "items": {
4148/// "$ref": "#/definitions/ResponseOutputContent"
4149/// }
4150/// },
4151/// "id": {
4152/// "description": "The unique ID of the output message.",
4153/// "type": "string"
4154/// },
4155/// "role": {
4156/// "description": "The role of the output message. Always `assistant`.",
4157/// "type": "string",
4158/// "enum": [
4159/// "assistant"
4160/// ]
4161/// },
4162/// "status": {
4163/// "description": "The status of the message.",
4164/// "type": "string",
4165/// "enum": [
4166/// "in_progress",
4167/// "completed",
4168/// "incomplete"
4169/// ]
4170/// },
4171/// "type": {
4172/// "description": "The type of the output item. Always `message`.",
4173/// "type": "string",
4174/// "enum": [
4175/// "message"
4176/// ]
4177/// }
4178/// }
4179///}
4180/// ```
4181/// </details>
4182#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4183pub struct ResponseOutputMessage {
4184 pub content: ::std::vec::Vec<ResponseOutputContent>,
4185 ///The unique ID of the output message.
4186 pub id: ::std::string::String,
4187 ///The role of the output message. Always `assistant`.
4188 pub role: ResponseOutputMessageRole,
4189 ///The status of the message.
4190 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4191 pub status: ::std::option::Option<ResponseOutputMessageStatus>,
4192 ///The type of the output item. Always `message`.
4193 #[serde(rename = "type")]
4194 pub type_: ResponseOutputMessageType,
4195}
4196///The role of the output message. Always `assistant`.
4197///
4198/// <details><summary>JSON schema</summary>
4199///
4200/// ```json
4201///{
4202/// "description": "The role of the output message. Always `assistant`.",
4203/// "type": "string",
4204/// "enum": [
4205/// "assistant"
4206/// ]
4207///}
4208/// ```
4209/// </details>
4210#[derive(
4211 ::serde::Deserialize,
4212 ::serde::Serialize,
4213 Clone,
4214 Copy,
4215 Debug,
4216 Eq,
4217 Hash,
4218 Ord,
4219 PartialEq,
4220 PartialOrd,
4221)]
4222pub enum ResponseOutputMessageRole {
4223 #[serde(rename = "assistant")]
4224 Assistant,
4225}
4226impl ::std::fmt::Display for ResponseOutputMessageRole {
4227 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4228 match *self {
4229 Self::Assistant => f.write_str("assistant"),
4230 }
4231 }
4232}
4233impl ::std::str::FromStr for ResponseOutputMessageRole {
4234 type Err = self::error::ConversionError;
4235 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4236 match value {
4237 "assistant" => Ok(Self::Assistant),
4238 _ => Err("invalid value".into()),
4239 }
4240 }
4241}
4242impl ::std::convert::TryFrom<&str> for ResponseOutputMessageRole {
4243 type Error = self::error::ConversionError;
4244 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4245 value.parse()
4246 }
4247}
4248impl ::std::convert::TryFrom<&::std::string::String> for ResponseOutputMessageRole {
4249 type Error = self::error::ConversionError;
4250 fn try_from(
4251 value: &::std::string::String,
4252 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4253 value.parse()
4254 }
4255}
4256impl ::std::convert::TryFrom<::std::string::String> for ResponseOutputMessageRole {
4257 type Error = self::error::ConversionError;
4258 fn try_from(
4259 value: ::std::string::String,
4260 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4261 value.parse()
4262 }
4263}
4264///The status of the message.
4265///
4266/// <details><summary>JSON schema</summary>
4267///
4268/// ```json
4269///{
4270/// "description": "The status of the message.",
4271/// "type": "string",
4272/// "enum": [
4273/// "in_progress",
4274/// "completed",
4275/// "incomplete"
4276/// ]
4277///}
4278/// ```
4279/// </details>
4280#[derive(
4281 ::serde::Deserialize,
4282 ::serde::Serialize,
4283 Clone,
4284 Copy,
4285 Debug,
4286 Eq,
4287 Hash,
4288 Ord,
4289 PartialEq,
4290 PartialOrd,
4291)]
4292pub enum ResponseOutputMessageStatus {
4293 #[serde(rename = "in_progress")]
4294 InProgress,
4295 #[serde(rename = "completed")]
4296 Completed,
4297 #[serde(rename = "incomplete")]
4298 Incomplete,
4299}
4300impl ::std::fmt::Display for ResponseOutputMessageStatus {
4301 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4302 match *self {
4303 Self::InProgress => f.write_str("in_progress"),
4304 Self::Completed => f.write_str("completed"),
4305 Self::Incomplete => f.write_str("incomplete"),
4306 }
4307 }
4308}
4309impl ::std::str::FromStr for ResponseOutputMessageStatus {
4310 type Err = self::error::ConversionError;
4311 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4312 match value {
4313 "in_progress" => Ok(Self::InProgress),
4314 "completed" => Ok(Self::Completed),
4315 "incomplete" => Ok(Self::Incomplete),
4316 _ => Err("invalid value".into()),
4317 }
4318 }
4319}
4320impl ::std::convert::TryFrom<&str> for ResponseOutputMessageStatus {
4321 type Error = self::error::ConversionError;
4322 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4323 value.parse()
4324 }
4325}
4326impl ::std::convert::TryFrom<&::std::string::String> for ResponseOutputMessageStatus {
4327 type Error = self::error::ConversionError;
4328 fn try_from(
4329 value: &::std::string::String,
4330 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4331 value.parse()
4332 }
4333}
4334impl ::std::convert::TryFrom<::std::string::String> for ResponseOutputMessageStatus {
4335 type Error = self::error::ConversionError;
4336 fn try_from(
4337 value: ::std::string::String,
4338 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4339 value.parse()
4340 }
4341}
4342///The type of the output item. Always `message`.
4343///
4344/// <details><summary>JSON schema</summary>
4345///
4346/// ```json
4347///{
4348/// "description": "The type of the output item. Always `message`.",
4349/// "type": "string",
4350/// "enum": [
4351/// "message"
4352/// ]
4353///}
4354/// ```
4355/// </details>
4356#[derive(
4357 ::serde::Deserialize,
4358 ::serde::Serialize,
4359 Clone,
4360 Copy,
4361 Debug,
4362 Eq,
4363 Hash,
4364 Ord,
4365 PartialEq,
4366 PartialOrd,
4367)]
4368pub enum ResponseOutputMessageType {
4369 #[serde(rename = "message")]
4370 Message,
4371}
4372impl ::std::fmt::Display for ResponseOutputMessageType {
4373 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4374 match *self {
4375 Self::Message => f.write_str("message"),
4376 }
4377 }
4378}
4379impl ::std::str::FromStr for ResponseOutputMessageType {
4380 type Err = self::error::ConversionError;
4381 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4382 match value {
4383 "message" => Ok(Self::Message),
4384 _ => Err("invalid value".into()),
4385 }
4386 }
4387}
4388impl ::std::convert::TryFrom<&str> for ResponseOutputMessageType {
4389 type Error = self::error::ConversionError;
4390 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4391 value.parse()
4392 }
4393}
4394impl ::std::convert::TryFrom<&::std::string::String> for ResponseOutputMessageType {
4395 type Error = self::error::ConversionError;
4396 fn try_from(
4397 value: &::std::string::String,
4398 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4399 value.parse()
4400 }
4401}
4402impl ::std::convert::TryFrom<::std::string::String> for ResponseOutputMessageType {
4403 type Error = self::error::ConversionError;
4404 fn try_from(
4405 value: ::std::string::String,
4406 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4407 value.parse()
4408 }
4409}
4410///A refusal generated by the model.
4411///
4412/// <details><summary>JSON schema</summary>
4413///
4414/// ```json
4415///{
4416/// "description": "A refusal generated by the model.",
4417/// "type": "object",
4418/// "required": [
4419/// "refusal",
4420/// "type"
4421/// ],
4422/// "properties": {
4423/// "refusal": {
4424/// "description": "The refusal explanation from the model.",
4425/// "type": "string"
4426/// },
4427/// "type": {
4428/// "description": "The type of the refusal. Always `refusal`.",
4429/// "type": "string",
4430/// "enum": [
4431/// "refusal"
4432/// ]
4433/// }
4434/// }
4435///}
4436/// ```
4437/// </details>
4438#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4439pub struct ResponseOutputRefusal {
4440 ///The refusal explanation from the model.
4441 pub refusal: ::std::string::String,
4442 ///The type of the refusal. Always `refusal`.
4443 #[serde(rename = "type")]
4444 pub type_: ResponseOutputRefusalType,
4445}
4446///The type of the refusal. Always `refusal`.
4447///
4448/// <details><summary>JSON schema</summary>
4449///
4450/// ```json
4451///{
4452/// "description": "The type of the refusal. Always `refusal`.",
4453/// "type": "string",
4454/// "enum": [
4455/// "refusal"
4456/// ]
4457///}
4458/// ```
4459/// </details>
4460#[derive(
4461 ::serde::Deserialize,
4462 ::serde::Serialize,
4463 Clone,
4464 Copy,
4465 Debug,
4466 Eq,
4467 Hash,
4468 Ord,
4469 PartialEq,
4470 PartialOrd,
4471)]
4472pub enum ResponseOutputRefusalType {
4473 #[serde(rename = "refusal")]
4474 Refusal,
4475}
4476impl ::std::fmt::Display for ResponseOutputRefusalType {
4477 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4478 match *self {
4479 Self::Refusal => f.write_str("refusal"),
4480 }
4481 }
4482}
4483impl ::std::str::FromStr for ResponseOutputRefusalType {
4484 type Err = self::error::ConversionError;
4485 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4486 match value {
4487 "refusal" => Ok(Self::Refusal),
4488 _ => Err("invalid value".into()),
4489 }
4490 }
4491}
4492impl ::std::convert::TryFrom<&str> for ResponseOutputRefusalType {
4493 type Error = self::error::ConversionError;
4494 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4495 value.parse()
4496 }
4497}
4498impl ::std::convert::TryFrom<&::std::string::String> for ResponseOutputRefusalType {
4499 type Error = self::error::ConversionError;
4500 fn try_from(
4501 value: &::std::string::String,
4502 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4503 value.parse()
4504 }
4505}
4506impl ::std::convert::TryFrom<::std::string::String> for ResponseOutputRefusalType {
4507 type Error = self::error::ConversionError;
4508 fn try_from(
4509 value: ::std::string::String,
4510 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4511 value.parse()
4512 }
4513}
4514///A text output from the model.
4515///
4516/// <details><summary>JSON schema</summary>
4517///
4518/// ```json
4519///{
4520/// "description": "A text output from the model.",
4521/// "type": "object",
4522/// "required": [
4523/// "text",
4524/// "type"
4525/// ],
4526/// "properties": {
4527/// "text": {
4528/// "description": "The text output from the model.",
4529/// "type": "string"
4530/// },
4531/// "type": {
4532/// "description": "The type of the output text. Always `output_text`.",
4533/// "type": "string",
4534/// "enum": [
4535/// "output_text"
4536/// ]
4537/// }
4538/// }
4539///}
4540/// ```
4541/// </details>
4542#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4543pub struct ResponseOutputText {
4544 ///The text output from the model.
4545 pub text: ::std::string::String,
4546 ///The type of the output text. Always `output_text`.
4547 #[serde(rename = "type")]
4548 pub type_: ResponseOutputTextType,
4549}
4550///The type of the output text. Always `output_text`.
4551///
4552/// <details><summary>JSON schema</summary>
4553///
4554/// ```json
4555///{
4556/// "description": "The type of the output text. Always `output_text`.",
4557/// "type": "string",
4558/// "enum": [
4559/// "output_text"
4560/// ]
4561///}
4562/// ```
4563/// </details>
4564#[derive(
4565 ::serde::Deserialize,
4566 ::serde::Serialize,
4567 Clone,
4568 Copy,
4569 Debug,
4570 Eq,
4571 Hash,
4572 Ord,
4573 PartialEq,
4574 PartialOrd,
4575)]
4576pub enum ResponseOutputTextType {
4577 #[serde(rename = "output_text")]
4578 OutputText,
4579}
4580impl ::std::fmt::Display for ResponseOutputTextType {
4581 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4582 match *self {
4583 Self::OutputText => f.write_str("output_text"),
4584 }
4585 }
4586}
4587impl ::std::str::FromStr for ResponseOutputTextType {
4588 type Err = self::error::ConversionError;
4589 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4590 match value {
4591 "output_text" => Ok(Self::OutputText),
4592 _ => Err("invalid value".into()),
4593 }
4594 }
4595}
4596impl ::std::convert::TryFrom<&str> for ResponseOutputTextType {
4597 type Error = self::error::ConversionError;
4598 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4599 value.parse()
4600 }
4601}
4602impl ::std::convert::TryFrom<&::std::string::String> for ResponseOutputTextType {
4603 type Error = self::error::ConversionError;
4604 fn try_from(
4605 value: &::std::string::String,
4606 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4607 value.parse()
4608 }
4609}
4610impl ::std::convert::TryFrom<::std::string::String> for ResponseOutputTextType {
4611 type Error = self::error::ConversionError;
4612 fn try_from(
4613 value: ::std::string::String,
4614 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4615 value.parse()
4616 }
4617}
4618///Configuration options for reasoning models.
4619///
4620/// <details><summary>JSON schema</summary>
4621///
4622/// ```json
4623///{
4624/// "description": "Configuration options for reasoning models.",
4625/// "type": "object",
4626/// "properties": {
4627/// "effort": {
4628/// "description": "Constrains the effort on reasoning for reasoning models. Reducing effort can result in faster responses and fewer reasoning tokens.\n",
4629/// "default": "medium",
4630/// "type": "string",
4631/// "enum": [
4632/// "minimal",
4633/// "low",
4634/// "medium",
4635/// "high"
4636/// ],
4637/// "nullable": true
4638/// },
4639/// "summary": {
4640/// "description": "A summary of the reasoning performed by the model, useful for debugging and understanding the model's reasoning process.\n",
4641/// "type": "string",
4642/// "enum": [
4643/// "auto",
4644/// "concise",
4645/// "detailed"
4646/// ],
4647/// "nullable": true
4648/// }
4649/// }
4650///}
4651/// ```
4652/// </details>
4653#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4654pub struct ResponseReasoning {
4655 /**Constrains the effort on reasoning for reasoning models. Reducing effort can result in faster responses and fewer reasoning tokens.
4656 */
4657 #[serde(default = "defaults::response_reasoning_effort")]
4658 pub effort: ResponseReasoningEffort,
4659 /**A summary of the reasoning performed by the model, useful for debugging and understanding the model's reasoning process.
4660 */
4661 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4662 pub summary: ::std::option::Option<ResponseReasoningSummary>,
4663}
4664impl ::std::default::Default for ResponseReasoning {
4665 fn default() -> Self {
4666 Self {
4667 effort: defaults::response_reasoning_effort(),
4668 summary: Default::default(),
4669 }
4670 }
4671}
4672/**Constrains the effort on reasoning for reasoning models. Reducing effort can result in faster responses and fewer reasoning tokens.
4673*/
4674///
4675/// <details><summary>JSON schema</summary>
4676///
4677/// ```json
4678///{
4679/// "description": "Constrains the effort on reasoning for reasoning models. Reducing effort can result in faster responses and fewer reasoning tokens.\n",
4680/// "default": "medium",
4681/// "type": "string",
4682/// "enum": [
4683/// "minimal",
4684/// "low",
4685/// "medium",
4686/// "high"
4687/// ],
4688/// "nullable": true
4689///}
4690/// ```
4691/// </details>
4692#[derive(
4693 ::serde::Deserialize,
4694 ::serde::Serialize,
4695 Clone,
4696 Copy,
4697 Debug,
4698 Eq,
4699 Hash,
4700 Ord,
4701 PartialEq,
4702 PartialOrd,
4703)]
4704pub enum ResponseReasoningEffort {
4705 #[serde(rename = "minimal")]
4706 Minimal,
4707 #[serde(rename = "low")]
4708 Low,
4709 #[serde(rename = "medium")]
4710 Medium,
4711 #[serde(rename = "high")]
4712 High,
4713}
4714impl ::std::fmt::Display for ResponseReasoningEffort {
4715 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4716 match *self {
4717 Self::Minimal => f.write_str("minimal"),
4718 Self::Low => f.write_str("low"),
4719 Self::Medium => f.write_str("medium"),
4720 Self::High => f.write_str("high"),
4721 }
4722 }
4723}
4724impl ::std::str::FromStr for ResponseReasoningEffort {
4725 type Err = self::error::ConversionError;
4726 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4727 match value {
4728 "minimal" => Ok(Self::Minimal),
4729 "low" => Ok(Self::Low),
4730 "medium" => Ok(Self::Medium),
4731 "high" => Ok(Self::High),
4732 _ => Err("invalid value".into()),
4733 }
4734 }
4735}
4736impl ::std::convert::TryFrom<&str> for ResponseReasoningEffort {
4737 type Error = self::error::ConversionError;
4738 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4739 value.parse()
4740 }
4741}
4742impl ::std::convert::TryFrom<&::std::string::String> for ResponseReasoningEffort {
4743 type Error = self::error::ConversionError;
4744 fn try_from(
4745 value: &::std::string::String,
4746 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4747 value.parse()
4748 }
4749}
4750impl ::std::convert::TryFrom<::std::string::String> for ResponseReasoningEffort {
4751 type Error = self::error::ConversionError;
4752 fn try_from(
4753 value: ::std::string::String,
4754 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4755 value.parse()
4756 }
4757}
4758impl ::std::default::Default for ResponseReasoningEffort {
4759 fn default() -> Self {
4760 ResponseReasoningEffort::Medium
4761 }
4762}
4763///A reasoning item describing the model's chain of thought.
4764///
4765/// <details><summary>JSON schema</summary>
4766///
4767/// ```json
4768///{
4769/// "description": "A reasoning item describing the model's chain of thought.",
4770/// "type": "object",
4771/// "required": [
4772/// "id",
4773/// "summary",
4774/// "type"
4775/// ],
4776/// "properties": {
4777/// "id": {
4778/// "description": "The unique ID of the reasoning item.",
4779/// "type": "string"
4780/// },
4781/// "status": {
4782/// "description": "The status of the reasoning item.",
4783/// "type": "string",
4784/// "enum": [
4785/// "in_progress",
4786/// "completed",
4787/// "incomplete"
4788/// ]
4789/// },
4790/// "summary": {
4791/// "description": "Reasoning summary content.",
4792/// "type": "array",
4793/// "items": {
4794/// "$ref": "#/definitions/ResponseReasoningSummaryPart"
4795/// }
4796/// },
4797/// "type": {
4798/// "description": "The type of the output item. Always `reasoning`.",
4799/// "type": "string",
4800/// "enum": [
4801/// "reasoning"
4802/// ]
4803/// }
4804/// }
4805///}
4806/// ```
4807/// </details>
4808#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4809pub struct ResponseReasoningItem {
4810 ///The unique ID of the reasoning item.
4811 pub id: ::std::string::String,
4812 ///The status of the reasoning item.
4813 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4814 pub status: ::std::option::Option<ResponseReasoningItemStatus>,
4815 ///Reasoning summary content.
4816 pub summary: ::std::vec::Vec<ResponseReasoningSummaryPart>,
4817 ///The type of the output item. Always `reasoning`.
4818 #[serde(rename = "type")]
4819 pub type_: ResponseReasoningItemType,
4820}
4821///The status of the reasoning item.
4822///
4823/// <details><summary>JSON schema</summary>
4824///
4825/// ```json
4826///{
4827/// "description": "The status of the reasoning item.",
4828/// "type": "string",
4829/// "enum": [
4830/// "in_progress",
4831/// "completed",
4832/// "incomplete"
4833/// ]
4834///}
4835/// ```
4836/// </details>
4837#[derive(
4838 ::serde::Deserialize,
4839 ::serde::Serialize,
4840 Clone,
4841 Copy,
4842 Debug,
4843 Eq,
4844 Hash,
4845 Ord,
4846 PartialEq,
4847 PartialOrd,
4848)]
4849pub enum ResponseReasoningItemStatus {
4850 #[serde(rename = "in_progress")]
4851 InProgress,
4852 #[serde(rename = "completed")]
4853 Completed,
4854 #[serde(rename = "incomplete")]
4855 Incomplete,
4856}
4857impl ::std::fmt::Display for ResponseReasoningItemStatus {
4858 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4859 match *self {
4860 Self::InProgress => f.write_str("in_progress"),
4861 Self::Completed => f.write_str("completed"),
4862 Self::Incomplete => f.write_str("incomplete"),
4863 }
4864 }
4865}
4866impl ::std::str::FromStr for ResponseReasoningItemStatus {
4867 type Err = self::error::ConversionError;
4868 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4869 match value {
4870 "in_progress" => Ok(Self::InProgress),
4871 "completed" => Ok(Self::Completed),
4872 "incomplete" => Ok(Self::Incomplete),
4873 _ => Err("invalid value".into()),
4874 }
4875 }
4876}
4877impl ::std::convert::TryFrom<&str> for ResponseReasoningItemStatus {
4878 type Error = self::error::ConversionError;
4879 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4880 value.parse()
4881 }
4882}
4883impl ::std::convert::TryFrom<&::std::string::String> for ResponseReasoningItemStatus {
4884 type Error = self::error::ConversionError;
4885 fn try_from(
4886 value: &::std::string::String,
4887 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4888 value.parse()
4889 }
4890}
4891impl ::std::convert::TryFrom<::std::string::String> for ResponseReasoningItemStatus {
4892 type Error = self::error::ConversionError;
4893 fn try_from(
4894 value: ::std::string::String,
4895 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4896 value.parse()
4897 }
4898}
4899///The type of the output item. Always `reasoning`.
4900///
4901/// <details><summary>JSON schema</summary>
4902///
4903/// ```json
4904///{
4905/// "description": "The type of the output item. Always `reasoning`.",
4906/// "type": "string",
4907/// "enum": [
4908/// "reasoning"
4909/// ]
4910///}
4911/// ```
4912/// </details>
4913#[derive(
4914 ::serde::Deserialize,
4915 ::serde::Serialize,
4916 Clone,
4917 Copy,
4918 Debug,
4919 Eq,
4920 Hash,
4921 Ord,
4922 PartialEq,
4923 PartialOrd,
4924)]
4925pub enum ResponseReasoningItemType {
4926 #[serde(rename = "reasoning")]
4927 Reasoning,
4928}
4929impl ::std::fmt::Display for ResponseReasoningItemType {
4930 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4931 match *self {
4932 Self::Reasoning => f.write_str("reasoning"),
4933 }
4934 }
4935}
4936impl ::std::str::FromStr for ResponseReasoningItemType {
4937 type Err = self::error::ConversionError;
4938 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4939 match value {
4940 "reasoning" => Ok(Self::Reasoning),
4941 _ => Err("invalid value".into()),
4942 }
4943 }
4944}
4945impl ::std::convert::TryFrom<&str> for ResponseReasoningItemType {
4946 type Error = self::error::ConversionError;
4947 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4948 value.parse()
4949 }
4950}
4951impl ::std::convert::TryFrom<&::std::string::String> for ResponseReasoningItemType {
4952 type Error = self::error::ConversionError;
4953 fn try_from(
4954 value: &::std::string::String,
4955 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4956 value.parse()
4957 }
4958}
4959impl ::std::convert::TryFrom<::std::string::String> for ResponseReasoningItemType {
4960 type Error = self::error::ConversionError;
4961 fn try_from(
4962 value: ::std::string::String,
4963 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4964 value.parse()
4965 }
4966}
4967/**A summary of the reasoning performed by the model, useful for debugging and understanding the model's reasoning process.
4968*/
4969///
4970/// <details><summary>JSON schema</summary>
4971///
4972/// ```json
4973///{
4974/// "description": "A summary of the reasoning performed by the model, useful for debugging and understanding the model's reasoning process.\n",
4975/// "type": "string",
4976/// "enum": [
4977/// "auto",
4978/// "concise",
4979/// "detailed"
4980/// ],
4981/// "nullable": true
4982///}
4983/// ```
4984/// </details>
4985#[derive(
4986 ::serde::Deserialize,
4987 ::serde::Serialize,
4988 Clone,
4989 Copy,
4990 Debug,
4991 Eq,
4992 Hash,
4993 Ord,
4994 PartialEq,
4995 PartialOrd,
4996)]
4997pub enum ResponseReasoningSummary {
4998 #[serde(rename = "auto")]
4999 Auto,
5000 #[serde(rename = "concise")]
5001 Concise,
5002 #[serde(rename = "detailed")]
5003 Detailed,
5004}
5005impl ::std::fmt::Display for ResponseReasoningSummary {
5006 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5007 match *self {
5008 Self::Auto => f.write_str("auto"),
5009 Self::Concise => f.write_str("concise"),
5010 Self::Detailed => f.write_str("detailed"),
5011 }
5012 }
5013}
5014impl ::std::str::FromStr for ResponseReasoningSummary {
5015 type Err = self::error::ConversionError;
5016 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5017 match value {
5018 "auto" => Ok(Self::Auto),
5019 "concise" => Ok(Self::Concise),
5020 "detailed" => Ok(Self::Detailed),
5021 _ => Err("invalid value".into()),
5022 }
5023 }
5024}
5025impl ::std::convert::TryFrom<&str> for ResponseReasoningSummary {
5026 type Error = self::error::ConversionError;
5027 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5028 value.parse()
5029 }
5030}
5031impl ::std::convert::TryFrom<&::std::string::String> for ResponseReasoningSummary {
5032 type Error = self::error::ConversionError;
5033 fn try_from(
5034 value: &::std::string::String,
5035 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5036 value.parse()
5037 }
5038}
5039impl ::std::convert::TryFrom<::std::string::String> for ResponseReasoningSummary {
5040 type Error = self::error::ConversionError;
5041 fn try_from(
5042 value: ::std::string::String,
5043 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5044 value.parse()
5045 }
5046}
5047///A summary part of a reasoning item.
5048///
5049/// <details><summary>JSON schema</summary>
5050///
5051/// ```json
5052///{
5053/// "description": "A summary part of a reasoning item.",
5054/// "type": "object",
5055/// "required": [
5056/// "text",
5057/// "type"
5058/// ],
5059/// "properties": {
5060/// "text": {
5061/// "description": "A summary of the reasoning output from the model.",
5062/// "type": "string"
5063/// },
5064/// "type": {
5065/// "description": "The type of the summary. Always `summary_text`.",
5066/// "type": "string",
5067/// "enum": [
5068/// "summary_text"
5069/// ]
5070/// }
5071/// }
5072///}
5073/// ```
5074/// </details>
5075#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5076pub struct ResponseReasoningSummaryPart {
5077 ///A summary of the reasoning output from the model.
5078 pub text: ::std::string::String,
5079 ///The type of the summary. Always `summary_text`.
5080 #[serde(rename = "type")]
5081 pub type_: ResponseReasoningSummaryPartType,
5082}
5083///The type of the summary. Always `summary_text`.
5084///
5085/// <details><summary>JSON schema</summary>
5086///
5087/// ```json
5088///{
5089/// "description": "The type of the summary. Always `summary_text`.",
5090/// "type": "string",
5091/// "enum": [
5092/// "summary_text"
5093/// ]
5094///}
5095/// ```
5096/// </details>
5097#[derive(
5098 ::serde::Deserialize,
5099 ::serde::Serialize,
5100 Clone,
5101 Copy,
5102 Debug,
5103 Eq,
5104 Hash,
5105 Ord,
5106 PartialEq,
5107 PartialOrd,
5108)]
5109pub enum ResponseReasoningSummaryPartType {
5110 #[serde(rename = "summary_text")]
5111 SummaryText,
5112}
5113impl ::std::fmt::Display for ResponseReasoningSummaryPartType {
5114 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5115 match *self {
5116 Self::SummaryText => f.write_str("summary_text"),
5117 }
5118 }
5119}
5120impl ::std::str::FromStr for ResponseReasoningSummaryPartType {
5121 type Err = self::error::ConversionError;
5122 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5123 match value {
5124 "summary_text" => Ok(Self::SummaryText),
5125 _ => Err("invalid value".into()),
5126 }
5127 }
5128}
5129impl ::std::convert::TryFrom<&str> for ResponseReasoningSummaryPartType {
5130 type Error = self::error::ConversionError;
5131 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5132 value.parse()
5133 }
5134}
5135impl ::std::convert::TryFrom<&::std::string::String> for ResponseReasoningSummaryPartType {
5136 type Error = self::error::ConversionError;
5137 fn try_from(
5138 value: &::std::string::String,
5139 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5140 value.parse()
5141 }
5142}
5143impl ::std::convert::TryFrom<::std::string::String> for ResponseReasoningSummaryPartType {
5144 type Error = self::error::ConversionError;
5145 fn try_from(
5146 value: ::std::string::String,
5147 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5148 value.parse()
5149 }
5150}
5151///The role of the message input.
5152///
5153/// <details><summary>JSON schema</summary>
5154///
5155/// ```json
5156///{
5157/// "description": "The role of the message input.",
5158/// "type": "string",
5159/// "enum": [
5160/// "user",
5161/// "assistant",
5162/// "system",
5163/// "developer"
5164/// ]
5165///}
5166/// ```
5167/// </details>
5168#[derive(
5169 ::serde::Deserialize,
5170 ::serde::Serialize,
5171 Clone,
5172 Copy,
5173 Debug,
5174 Eq,
5175 Hash,
5176 Ord,
5177 PartialEq,
5178 PartialOrd,
5179)]
5180pub enum ResponseRole {
5181 #[serde(rename = "user")]
5182 User,
5183 #[serde(rename = "assistant")]
5184 Assistant,
5185 #[serde(rename = "system")]
5186 System,
5187 #[serde(rename = "developer")]
5188 Developer,
5189}
5190impl ::std::fmt::Display for ResponseRole {
5191 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5192 match *self {
5193 Self::User => f.write_str("user"),
5194 Self::Assistant => f.write_str("assistant"),
5195 Self::System => f.write_str("system"),
5196 Self::Developer => f.write_str("developer"),
5197 }
5198 }
5199}
5200impl ::std::str::FromStr for ResponseRole {
5201 type Err = self::error::ConversionError;
5202 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5203 match value {
5204 "user" => Ok(Self::User),
5205 "assistant" => Ok(Self::Assistant),
5206 "system" => Ok(Self::System),
5207 "developer" => Ok(Self::Developer),
5208 _ => Err("invalid value".into()),
5209 }
5210 }
5211}
5212impl ::std::convert::TryFrom<&str> for ResponseRole {
5213 type Error = self::error::ConversionError;
5214 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5215 value.parse()
5216 }
5217}
5218impl ::std::convert::TryFrom<&::std::string::String> for ResponseRole {
5219 type Error = self::error::ConversionError;
5220 fn try_from(
5221 value: &::std::string::String,
5222 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5223 value.parse()
5224 }
5225}
5226impl ::std::convert::TryFrom<::std::string::String> for ResponseRole {
5227 type Error = self::error::ConversionError;
5228 fn try_from(
5229 value: ::std::string::String,
5230 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5231 value.parse()
5232 }
5233}
5234///The status of the response generation.
5235///
5236/// <details><summary>JSON schema</summary>
5237///
5238/// ```json
5239///{
5240/// "description": "The status of the response generation.",
5241/// "type": "string",
5242/// "enum": [
5243/// "completed",
5244/// "failed",
5245/// "in_progress",
5246/// "cancelled",
5247/// "queued",
5248/// "incomplete"
5249/// ]
5250///}
5251/// ```
5252/// </details>
5253#[derive(
5254 ::serde::Deserialize,
5255 ::serde::Serialize,
5256 Clone,
5257 Copy,
5258 Debug,
5259 Eq,
5260 Hash,
5261 Ord,
5262 PartialEq,
5263 PartialOrd,
5264)]
5265pub enum ResponseStatus {
5266 #[serde(rename = "completed")]
5267 Completed,
5268 #[serde(rename = "failed")]
5269 Failed,
5270 #[serde(rename = "in_progress")]
5271 InProgress,
5272 #[serde(rename = "cancelled")]
5273 Cancelled,
5274 #[serde(rename = "queued")]
5275 Queued,
5276 #[serde(rename = "incomplete")]
5277 Incomplete,
5278}
5279impl ::std::fmt::Display for ResponseStatus {
5280 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5281 match *self {
5282 Self::Completed => f.write_str("completed"),
5283 Self::Failed => f.write_str("failed"),
5284 Self::InProgress => f.write_str("in_progress"),
5285 Self::Cancelled => f.write_str("cancelled"),
5286 Self::Queued => f.write_str("queued"),
5287 Self::Incomplete => f.write_str("incomplete"),
5288 }
5289 }
5290}
5291impl ::std::str::FromStr for ResponseStatus {
5292 type Err = self::error::ConversionError;
5293 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5294 match value {
5295 "completed" => Ok(Self::Completed),
5296 "failed" => Ok(Self::Failed),
5297 "in_progress" => Ok(Self::InProgress),
5298 "cancelled" => Ok(Self::Cancelled),
5299 "queued" => Ok(Self::Queued),
5300 "incomplete" => Ok(Self::Incomplete),
5301 _ => Err("invalid value".into()),
5302 }
5303 }
5304}
5305impl ::std::convert::TryFrom<&str> for ResponseStatus {
5306 type Error = self::error::ConversionError;
5307 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5308 value.parse()
5309 }
5310}
5311impl ::std::convert::TryFrom<&::std::string::String> for ResponseStatus {
5312 type Error = self::error::ConversionError;
5313 fn try_from(
5314 value: &::std::string::String,
5315 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5316 value.parse()
5317 }
5318}
5319impl ::std::convert::TryFrom<::std::string::String> for ResponseStatus {
5320 type Error = self::error::ConversionError;
5321 fn try_from(
5322 value: ::std::string::String,
5323 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5324 value.parse()
5325 }
5326}
5327/**A server-sent event emitted while streaming a response. The Responses API emits a sequence of typed events (for example `response.created`, `response.output_text.delta`, and `response.completed`). This schema models the common event envelope; which fields are populated depends on the event `type`.
5328*/
5329///
5330/// <details><summary>JSON schema</summary>
5331///
5332/// ```json
5333///{
5334/// "description": "A server-sent event emitted while streaming a response. The Responses API emits a sequence of typed events (for example `response.created`, `response.output_text.delta`, and `response.completed`). This schema models the common event envelope; which fields are populated depends on the event `type`.\n",
5335/// "type": "object",
5336/// "required": [
5337/// "type"
5338/// ],
5339/// "properties": {
5340/// "content_index": {
5341/// "description": "The index of the content part within the output item.",
5342/// "type": "integer"
5343/// },
5344/// "delta": {
5345/// "description": "The incremental text delta for `*.delta` events.",
5346/// "type": "string"
5347/// },
5348/// "item_id": {
5349/// "description": "The ID of the output item this event relates to.",
5350/// "type": "string"
5351/// },
5352/// "output_index": {
5353/// "description": "The index of the output item in the response's output array.",
5354/// "type": "integer"
5355/// },
5356/// "response": {
5357/// "$ref": "#/definitions/Response"
5358/// },
5359/// "sequence_number": {
5360/// "description": "The sequence number of this event.",
5361/// "type": "integer"
5362/// },
5363/// "text": {
5364/// "description": "The finalized text for `*.done` events.",
5365/// "type": "string"
5366/// },
5367/// "type": {
5368/// "description": "The type of the streamed event, for example `response.output_text.delta` or `response.completed`.\n",
5369/// "type": "string"
5370/// }
5371/// }
5372///}
5373/// ```
5374/// </details>
5375#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5376pub struct ResponseStreamEvent {
5377 ///The index of the content part within the output item.
5378 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5379 pub content_index: ::std::option::Option<i64>,
5380 ///The incremental text delta for `*.delta` events.
5381 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5382 pub delta: ::std::option::Option<::std::string::String>,
5383 ///The ID of the output item this event relates to.
5384 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5385 pub item_id: ::std::option::Option<::std::string::String>,
5386 ///The index of the output item in the response's output array.
5387 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5388 pub output_index: ::std::option::Option<i64>,
5389 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5390 pub response: ::std::option::Option<Response>,
5391 ///The sequence number of this event.
5392 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5393 pub sequence_number: ::std::option::Option<i64>,
5394 ///The finalized text for `*.done` events.
5395 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5396 pub text: ::std::option::Option<::std::string::String>,
5397 /**The type of the streamed event, for example `response.output_text.delta` or `response.completed`.
5398 */
5399 #[serde(rename = "type")]
5400 pub type_: ::std::string::String,
5401}
5402/**Configuration options for a text response from the model. Can be plain text or structured JSON data.
5403*/
5404///
5405/// <details><summary>JSON schema</summary>
5406///
5407/// ```json
5408///{
5409/// "description": "Configuration options for a text response from the model. Can be plain text or structured JSON data.\n",
5410/// "type": "object",
5411/// "properties": {
5412/// "format": {
5413/// "description": "An object specifying the format that the model must output.",
5414/// "type": "object",
5415/// "required": [
5416/// "type"
5417/// ],
5418/// "properties": {
5419/// "name": {
5420/// "description": "The name of the response format (used with `json_schema`).",
5421/// "type": "string"
5422/// },
5423/// "schema": {
5424/// "$ref": "#/definitions/FunctionParameters"
5425/// },
5426/// "strict": {
5427/// "description": "Whether to enable strict schema adherence.",
5428/// "default": false,
5429/// "type": "boolean"
5430/// },
5431/// "type": {
5432/// "description": "The type of response format being defined.",
5433/// "type": "string",
5434/// "enum": [
5435/// "text",
5436/// "json_schema",
5437/// "json_object"
5438/// ]
5439/// }
5440/// }
5441/// }
5442/// }
5443///}
5444/// ```
5445/// </details>
5446#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5447pub struct ResponseTextConfig {
5448 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5449 pub format: ::std::option::Option<ResponseTextConfigFormat>,
5450}
5451impl ::std::default::Default for ResponseTextConfig {
5452 fn default() -> Self {
5453 Self {
5454 format: Default::default(),
5455 }
5456 }
5457}
5458///An object specifying the format that the model must output.
5459///
5460/// <details><summary>JSON schema</summary>
5461///
5462/// ```json
5463///{
5464/// "description": "An object specifying the format that the model must output.",
5465/// "type": "object",
5466/// "required": [
5467/// "type"
5468/// ],
5469/// "properties": {
5470/// "name": {
5471/// "description": "The name of the response format (used with `json_schema`).",
5472/// "type": "string"
5473/// },
5474/// "schema": {
5475/// "$ref": "#/definitions/FunctionParameters"
5476/// },
5477/// "strict": {
5478/// "description": "Whether to enable strict schema adherence.",
5479/// "default": false,
5480/// "type": "boolean"
5481/// },
5482/// "type": {
5483/// "description": "The type of response format being defined.",
5484/// "type": "string",
5485/// "enum": [
5486/// "text",
5487/// "json_schema",
5488/// "json_object"
5489/// ]
5490/// }
5491/// }
5492///}
5493/// ```
5494/// </details>
5495#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5496pub struct ResponseTextConfigFormat {
5497 ///The name of the response format (used with `json_schema`).
5498 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5499 pub name: ::std::option::Option<::std::string::String>,
5500 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5501 pub schema: ::std::option::Option<FunctionParameters>,
5502 ///Whether to enable strict schema adherence.
5503 #[serde(default)]
5504 pub strict: bool,
5505 ///The type of response format being defined.
5506 #[serde(rename = "type")]
5507 pub type_: ResponseTextConfigFormatType,
5508}
5509///The type of response format being defined.
5510///
5511/// <details><summary>JSON schema</summary>
5512///
5513/// ```json
5514///{
5515/// "description": "The type of response format being defined.",
5516/// "type": "string",
5517/// "enum": [
5518/// "text",
5519/// "json_schema",
5520/// "json_object"
5521/// ]
5522///}
5523/// ```
5524/// </details>
5525#[derive(
5526 ::serde::Deserialize,
5527 ::serde::Serialize,
5528 Clone,
5529 Copy,
5530 Debug,
5531 Eq,
5532 Hash,
5533 Ord,
5534 PartialEq,
5535 PartialOrd,
5536)]
5537pub enum ResponseTextConfigFormatType {
5538 #[serde(rename = "text")]
5539 Text,
5540 #[serde(rename = "json_schema")]
5541 JsonSchema,
5542 #[serde(rename = "json_object")]
5543 JsonObject,
5544}
5545impl ::std::fmt::Display for ResponseTextConfigFormatType {
5546 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5547 match *self {
5548 Self::Text => f.write_str("text"),
5549 Self::JsonSchema => f.write_str("json_schema"),
5550 Self::JsonObject => f.write_str("json_object"),
5551 }
5552 }
5553}
5554impl ::std::str::FromStr for ResponseTextConfigFormatType {
5555 type Err = self::error::ConversionError;
5556 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5557 match value {
5558 "text" => Ok(Self::Text),
5559 "json_schema" => Ok(Self::JsonSchema),
5560 "json_object" => Ok(Self::JsonObject),
5561 _ => Err("invalid value".into()),
5562 }
5563 }
5564}
5565impl ::std::convert::TryFrom<&str> for ResponseTextConfigFormatType {
5566 type Error = self::error::ConversionError;
5567 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5568 value.parse()
5569 }
5570}
5571impl ::std::convert::TryFrom<&::std::string::String> for ResponseTextConfigFormatType {
5572 type Error = self::error::ConversionError;
5573 fn try_from(
5574 value: &::std::string::String,
5575 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5576 value.parse()
5577 }
5578}
5579impl ::std::convert::TryFrom<::std::string::String> for ResponseTextConfigFormatType {
5580 type Error = self::error::ConversionError;
5581 fn try_from(
5582 value: ::std::string::String,
5583 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5584 value.parse()
5585 }
5586}
5587/**A tool the model may call. Only function tools are modeled here. Note the Responses API uses a flattened function tool shape (`name`, `description`, and `parameters` at the top level) rather than nesting them under a `function` object as `/chat/completions` does.
5588*/
5589///
5590/// <details><summary>JSON schema</summary>
5591///
5592/// ```json
5593///{
5594/// "description": "A tool the model may call. Only function tools are modeled here. Note the Responses API uses a flattened function tool shape (`name`, `description`, and `parameters` at the top level) rather than nesting them under a `function` object as `/chat/completions` does.\n",
5595/// "type": "object",
5596/// "required": [
5597/// "name",
5598/// "type"
5599/// ],
5600/// "properties": {
5601/// "description": {
5602/// "description": "A description of the function, used by the model to decide when and how to call it.\n",
5603/// "type": "string"
5604/// },
5605/// "name": {
5606/// "description": "The name of the function to call.",
5607/// "type": "string"
5608/// },
5609/// "parameters": {
5610/// "$ref": "#/definitions/FunctionParameters"
5611/// },
5612/// "strict": {
5613/// "description": "Whether to enforce strict parameter validation.",
5614/// "default": false,
5615/// "type": "boolean"
5616/// },
5617/// "type": {
5618/// "description": "The type of the tool. Currently only `function`.",
5619/// "type": "string",
5620/// "enum": [
5621/// "function"
5622/// ]
5623/// }
5624/// }
5625///}
5626/// ```
5627/// </details>
5628#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5629pub struct ResponseTool {
5630 /**A description of the function, used by the model to decide when and how to call it.
5631 */
5632 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5633 pub description: ::std::option::Option<::std::string::String>,
5634 ///The name of the function to call.
5635 pub name: ::std::string::String,
5636 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5637 pub parameters: ::std::option::Option<FunctionParameters>,
5638 ///Whether to enforce strict parameter validation.
5639 #[serde(default)]
5640 pub strict: bool,
5641 ///The type of the tool. Currently only `function`.
5642 #[serde(rename = "type")]
5643 pub type_: ResponseToolType,
5644}
5645/**How the model should select which tool (or tools) to use. Either a mode string (`none`, `auto`, `required`) or an object forcing a specific tool.
5646*/
5647///
5648/// <details><summary>JSON schema</summary>
5649///
5650/// ```json
5651///{
5652/// "description": "How the model should select which tool (or tools) to use. Either a mode string (`none`, `auto`, `required`) or an object forcing a specific tool.\n",
5653/// "oneOf": [
5654/// {
5655/// "description": "The tool-choice mode.",
5656/// "type": "string",
5657/// "enum": [
5658/// "none",
5659/// "auto",
5660/// "required"
5661/// ]
5662/// },
5663/// {
5664/// "description": "Forces the model to call a specific function tool.",
5665/// "type": "object",
5666/// "required": [
5667/// "name",
5668/// "type"
5669/// ],
5670/// "properties": {
5671/// "name": {
5672/// "type": "string"
5673/// },
5674/// "type": {
5675/// "type": "string",
5676/// "enum": [
5677/// "function"
5678/// ]
5679/// }
5680/// }
5681/// }
5682/// ]
5683///}
5684/// ```
5685/// </details>
5686#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5687#[serde(untagged)]
5688pub enum ResponseToolChoice {
5689 String(ResponseToolChoiceString),
5690 Object {
5691 name: ::std::string::String,
5692 #[serde(rename = "type")]
5693 type_: ResponseToolChoiceObjectType,
5694 },
5695}
5696impl ::std::convert::From<ResponseToolChoiceString> for ResponseToolChoice {
5697 fn from(value: ResponseToolChoiceString) -> Self {
5698 Self::String(value)
5699 }
5700}
5701///`ResponseToolChoiceObjectType`
5702///
5703/// <details><summary>JSON schema</summary>
5704///
5705/// ```json
5706///{
5707/// "type": "string",
5708/// "enum": [
5709/// "function"
5710/// ]
5711///}
5712/// ```
5713/// </details>
5714#[derive(
5715 ::serde::Deserialize,
5716 ::serde::Serialize,
5717 Clone,
5718 Copy,
5719 Debug,
5720 Eq,
5721 Hash,
5722 Ord,
5723 PartialEq,
5724 PartialOrd,
5725)]
5726pub enum ResponseToolChoiceObjectType {
5727 #[serde(rename = "function")]
5728 Function,
5729}
5730impl ::std::fmt::Display for ResponseToolChoiceObjectType {
5731 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5732 match *self {
5733 Self::Function => f.write_str("function"),
5734 }
5735 }
5736}
5737impl ::std::str::FromStr for ResponseToolChoiceObjectType {
5738 type Err = self::error::ConversionError;
5739 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5740 match value {
5741 "function" => Ok(Self::Function),
5742 _ => Err("invalid value".into()),
5743 }
5744 }
5745}
5746impl ::std::convert::TryFrom<&str> for ResponseToolChoiceObjectType {
5747 type Error = self::error::ConversionError;
5748 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5749 value.parse()
5750 }
5751}
5752impl ::std::convert::TryFrom<&::std::string::String> for ResponseToolChoiceObjectType {
5753 type Error = self::error::ConversionError;
5754 fn try_from(
5755 value: &::std::string::String,
5756 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5757 value.parse()
5758 }
5759}
5760impl ::std::convert::TryFrom<::std::string::String> for ResponseToolChoiceObjectType {
5761 type Error = self::error::ConversionError;
5762 fn try_from(
5763 value: ::std::string::String,
5764 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5765 value.parse()
5766 }
5767}
5768///The tool-choice mode.
5769///
5770/// <details><summary>JSON schema</summary>
5771///
5772/// ```json
5773///{
5774/// "description": "The tool-choice mode.",
5775/// "type": "string",
5776/// "enum": [
5777/// "none",
5778/// "auto",
5779/// "required"
5780/// ]
5781///}
5782/// ```
5783/// </details>
5784#[derive(
5785 ::serde::Deserialize,
5786 ::serde::Serialize,
5787 Clone,
5788 Copy,
5789 Debug,
5790 Eq,
5791 Hash,
5792 Ord,
5793 PartialEq,
5794 PartialOrd,
5795)]
5796pub enum ResponseToolChoiceString {
5797 #[serde(rename = "none")]
5798 None,
5799 #[serde(rename = "auto")]
5800 Auto,
5801 #[serde(rename = "required")]
5802 Required,
5803}
5804impl ::std::fmt::Display for ResponseToolChoiceString {
5805 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5806 match *self {
5807 Self::None => f.write_str("none"),
5808 Self::Auto => f.write_str("auto"),
5809 Self::Required => f.write_str("required"),
5810 }
5811 }
5812}
5813impl ::std::str::FromStr for ResponseToolChoiceString {
5814 type Err = self::error::ConversionError;
5815 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5816 match value {
5817 "none" => Ok(Self::None),
5818 "auto" => Ok(Self::Auto),
5819 "required" => Ok(Self::Required),
5820 _ => Err("invalid value".into()),
5821 }
5822 }
5823}
5824impl ::std::convert::TryFrom<&str> for ResponseToolChoiceString {
5825 type Error = self::error::ConversionError;
5826 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5827 value.parse()
5828 }
5829}
5830impl ::std::convert::TryFrom<&::std::string::String> for ResponseToolChoiceString {
5831 type Error = self::error::ConversionError;
5832 fn try_from(
5833 value: &::std::string::String,
5834 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5835 value.parse()
5836 }
5837}
5838impl ::std::convert::TryFrom<::std::string::String> for ResponseToolChoiceString {
5839 type Error = self::error::ConversionError;
5840 fn try_from(
5841 value: ::std::string::String,
5842 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5843 value.parse()
5844 }
5845}
5846///The type of the tool. Currently only `function`.
5847///
5848/// <details><summary>JSON schema</summary>
5849///
5850/// ```json
5851///{
5852/// "description": "The type of the tool. Currently only `function`.",
5853/// "type": "string",
5854/// "enum": [
5855/// "function"
5856/// ]
5857///}
5858/// ```
5859/// </details>
5860#[derive(
5861 ::serde::Deserialize,
5862 ::serde::Serialize,
5863 Clone,
5864 Copy,
5865 Debug,
5866 Eq,
5867 Hash,
5868 Ord,
5869 PartialEq,
5870 PartialOrd,
5871)]
5872pub enum ResponseToolType {
5873 #[serde(rename = "function")]
5874 Function,
5875}
5876impl ::std::fmt::Display for ResponseToolType {
5877 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5878 match *self {
5879 Self::Function => f.write_str("function"),
5880 }
5881 }
5882}
5883impl ::std::str::FromStr for ResponseToolType {
5884 type Err = self::error::ConversionError;
5885 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5886 match value {
5887 "function" => Ok(Self::Function),
5888 _ => Err("invalid value".into()),
5889 }
5890 }
5891}
5892impl ::std::convert::TryFrom<&str> for ResponseToolType {
5893 type Error = self::error::ConversionError;
5894 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5895 value.parse()
5896 }
5897}
5898impl ::std::convert::TryFrom<&::std::string::String> for ResponseToolType {
5899 type Error = self::error::ConversionError;
5900 fn try_from(
5901 value: &::std::string::String,
5902 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5903 value.parse()
5904 }
5905}
5906impl ::std::convert::TryFrom<::std::string::String> for ResponseToolType {
5907 type Error = self::error::ConversionError;
5908 fn try_from(
5909 value: ::std::string::String,
5910 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5911 value.parse()
5912 }
5913}
5914///Token usage details for the response.
5915///
5916/// <details><summary>JSON schema</summary>
5917///
5918/// ```json
5919///{
5920/// "description": "Token usage details for the response.",
5921/// "type": "object",
5922/// "required": [
5923/// "input_tokens",
5924/// "output_tokens",
5925/// "total_tokens"
5926/// ],
5927/// "properties": {
5928/// "input_tokens": {
5929/// "description": "The number of input tokens.",
5930/// "default": 0,
5931/// "type": "integer",
5932/// "format": "int64"
5933/// },
5934/// "input_tokens_details": {
5935/// "description": "A detailed breakdown of the input tokens.",
5936/// "type": "object",
5937/// "properties": {
5938/// "cached_tokens": {
5939/// "description": "The number of tokens retrieved from the cache.",
5940/// "default": 0,
5941/// "type": "integer",
5942/// "format": "int64"
5943/// }
5944/// }
5945/// },
5946/// "output_tokens": {
5947/// "description": "The number of output tokens.",
5948/// "default": 0,
5949/// "type": "integer",
5950/// "format": "int64"
5951/// },
5952/// "output_tokens_details": {
5953/// "description": "A detailed breakdown of the output tokens.",
5954/// "type": "object",
5955/// "properties": {
5956/// "reasoning_tokens": {
5957/// "description": "The number of reasoning tokens.",
5958/// "default": 0,
5959/// "type": "integer",
5960/// "format": "int64"
5961/// }
5962/// }
5963/// },
5964/// "total_tokens": {
5965/// "description": "The total number of tokens used (input + output).",
5966/// "default": 0,
5967/// "type": "integer",
5968/// "format": "int64"
5969/// }
5970/// }
5971///}
5972/// ```
5973/// </details>
5974#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5975pub struct ResponseUsage {
5976 ///The number of input tokens.
5977 pub input_tokens: i64,
5978 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5979 pub input_tokens_details: ::std::option::Option<ResponseUsageInputTokensDetails>,
5980 ///The number of output tokens.
5981 pub output_tokens: i64,
5982 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5983 pub output_tokens_details: ::std::option::Option<ResponseUsageOutputTokensDetails>,
5984 ///The total number of tokens used (input + output).
5985 pub total_tokens: i64,
5986}
5987///A detailed breakdown of the input tokens.
5988///
5989/// <details><summary>JSON schema</summary>
5990///
5991/// ```json
5992///{
5993/// "description": "A detailed breakdown of the input tokens.",
5994/// "type": "object",
5995/// "properties": {
5996/// "cached_tokens": {
5997/// "description": "The number of tokens retrieved from the cache.",
5998/// "default": 0,
5999/// "type": "integer",
6000/// "format": "int64"
6001/// }
6002/// }
6003///}
6004/// ```
6005/// </details>
6006#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6007pub struct ResponseUsageInputTokensDetails {
6008 ///The number of tokens retrieved from the cache.
6009 #[serde(default)]
6010 pub cached_tokens: i64,
6011}
6012impl ::std::default::Default for ResponseUsageInputTokensDetails {
6013 fn default() -> Self {
6014 Self {
6015 cached_tokens: Default::default(),
6016 }
6017 }
6018}
6019///A detailed breakdown of the output tokens.
6020///
6021/// <details><summary>JSON schema</summary>
6022///
6023/// ```json
6024///{
6025/// "description": "A detailed breakdown of the output tokens.",
6026/// "type": "object",
6027/// "properties": {
6028/// "reasoning_tokens": {
6029/// "description": "The number of reasoning tokens.",
6030/// "default": 0,
6031/// "type": "integer",
6032/// "format": "int64"
6033/// }
6034/// }
6035///}
6036/// ```
6037/// </details>
6038#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6039pub struct ResponseUsageOutputTokensDetails {
6040 ///The number of reasoning tokens.
6041 #[serde(default)]
6042 pub reasoning_tokens: i64,
6043}
6044impl ::std::default::Default for ResponseUsageOutputTokensDetails {
6045 fn default() -> Self {
6046 Self {
6047 reasoning_tokens: Default::default(),
6048 }
6049 }
6050}
6051///`SsEvent`
6052///
6053/// <details><summary>JSON schema</summary>
6054///
6055/// ```json
6056///{
6057/// "type": "object",
6058/// "properties": {
6059/// "data": {
6060/// "type": "string",
6061/// "format": "byte"
6062/// },
6063/// "event": {
6064/// "type": "string",
6065/// "enum": [
6066/// "message-start",
6067/// "stream-start",
6068/// "content-start",
6069/// "content-delta",
6070/// "content-end",
6071/// "message-end",
6072/// "stream-end"
6073/// ]
6074/// },
6075/// "retry": {
6076/// "type": "integer"
6077/// }
6078/// }
6079///}
6080/// ```
6081/// </details>
6082#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6083pub struct SsEvent {
6084 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6085 pub data: ::std::option::Option<::std::string::String>,
6086 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6087 pub event: ::std::option::Option<SsEventEvent>,
6088 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6089 pub retry: ::std::option::Option<i64>,
6090}
6091impl ::std::default::Default for SsEvent {
6092 fn default() -> Self {
6093 Self {
6094 data: Default::default(),
6095 event: Default::default(),
6096 retry: Default::default(),
6097 }
6098 }
6099}
6100///`SsEventEvent`
6101///
6102/// <details><summary>JSON schema</summary>
6103///
6104/// ```json
6105///{
6106/// "type": "string",
6107/// "enum": [
6108/// "message-start",
6109/// "stream-start",
6110/// "content-start",
6111/// "content-delta",
6112/// "content-end",
6113/// "message-end",
6114/// "stream-end"
6115/// ]
6116///}
6117/// ```
6118/// </details>
6119#[derive(
6120 ::serde::Deserialize,
6121 ::serde::Serialize,
6122 Clone,
6123 Copy,
6124 Debug,
6125 Eq,
6126 Hash,
6127 Ord,
6128 PartialEq,
6129 PartialOrd,
6130)]
6131pub enum SsEventEvent {
6132 #[serde(rename = "message-start")]
6133 MessageStart,
6134 #[serde(rename = "stream-start")]
6135 StreamStart,
6136 #[serde(rename = "content-start")]
6137 ContentStart,
6138 #[serde(rename = "content-delta")]
6139 ContentDelta,
6140 #[serde(rename = "content-end")]
6141 ContentEnd,
6142 #[serde(rename = "message-end")]
6143 MessageEnd,
6144 #[serde(rename = "stream-end")]
6145 StreamEnd,
6146}
6147impl ::std::fmt::Display for SsEventEvent {
6148 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6149 match *self {
6150 Self::MessageStart => f.write_str("message-start"),
6151 Self::StreamStart => f.write_str("stream-start"),
6152 Self::ContentStart => f.write_str("content-start"),
6153 Self::ContentDelta => f.write_str("content-delta"),
6154 Self::ContentEnd => f.write_str("content-end"),
6155 Self::MessageEnd => f.write_str("message-end"),
6156 Self::StreamEnd => f.write_str("stream-end"),
6157 }
6158 }
6159}
6160impl ::std::str::FromStr for SsEventEvent {
6161 type Err = self::error::ConversionError;
6162 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6163 match value {
6164 "message-start" => Ok(Self::MessageStart),
6165 "stream-start" => Ok(Self::StreamStart),
6166 "content-start" => Ok(Self::ContentStart),
6167 "content-delta" => Ok(Self::ContentDelta),
6168 "content-end" => Ok(Self::ContentEnd),
6169 "message-end" => Ok(Self::MessageEnd),
6170 "stream-end" => Ok(Self::StreamEnd),
6171 _ => Err("invalid value".into()),
6172 }
6173 }
6174}
6175impl ::std::convert::TryFrom<&str> for SsEventEvent {
6176 type Error = self::error::ConversionError;
6177 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6178 value.parse()
6179 }
6180}
6181impl ::std::convert::TryFrom<&::std::string::String> for SsEventEvent {
6182 type Error = self::error::ConversionError;
6183 fn try_from(
6184 value: &::std::string::String,
6185 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6186 value.parse()
6187 }
6188}
6189impl ::std::convert::TryFrom<::std::string::String> for SsEventEvent {
6190 type Error = self::error::ConversionError;
6191 fn try_from(
6192 value: ::std::string::String,
6193 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6194 value.parse()
6195 }
6196}
6197///Text content part
6198///
6199/// <details><summary>JSON schema</summary>
6200///
6201/// ```json
6202///{
6203/// "description": "Text content part",
6204/// "type": "object",
6205/// "required": [
6206/// "text",
6207/// "type"
6208/// ],
6209/// "properties": {
6210/// "text": {
6211/// "description": "The text content",
6212/// "type": "string"
6213/// },
6214/// "type": {
6215/// "description": "Content type identifier",
6216/// "type": "string",
6217/// "enum": [
6218/// "text"
6219/// ]
6220/// }
6221/// }
6222///}
6223/// ```
6224/// </details>
6225#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6226pub struct TextContentPart {
6227 ///The text content
6228 pub text: ::std::string::String,
6229 ///Content type identifier
6230 #[serde(rename = "type")]
6231 pub type_: TextContentPartType,
6232}
6233///Content type identifier
6234///
6235/// <details><summary>JSON schema</summary>
6236///
6237/// ```json
6238///{
6239/// "description": "Content type identifier",
6240/// "type": "string",
6241/// "enum": [
6242/// "text"
6243/// ]
6244///}
6245/// ```
6246/// </details>
6247#[derive(
6248 ::serde::Deserialize,
6249 ::serde::Serialize,
6250 Clone,
6251 Copy,
6252 Debug,
6253 Eq,
6254 Hash,
6255 Ord,
6256 PartialEq,
6257 PartialOrd,
6258)]
6259pub enum TextContentPartType {
6260 #[serde(rename = "text")]
6261 Text,
6262}
6263impl ::std::fmt::Display for TextContentPartType {
6264 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6265 match *self {
6266 Self::Text => f.write_str("text"),
6267 }
6268 }
6269}
6270impl ::std::str::FromStr for TextContentPartType {
6271 type Err = self::error::ConversionError;
6272 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6273 match value {
6274 "text" => Ok(Self::Text),
6275 _ => Err("invalid value".into()),
6276 }
6277 }
6278}
6279impl ::std::convert::TryFrom<&str> for TextContentPartType {
6280 type Error = self::error::ConversionError;
6281 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6282 value.parse()
6283 }
6284}
6285impl ::std::convert::TryFrom<&::std::string::String> for TextContentPartType {
6286 type Error = self::error::ConversionError;
6287 fn try_from(
6288 value: &::std::string::String,
6289 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6290 value.parse()
6291 }
6292}
6293impl ::std::convert::TryFrom<::std::string::String> for TextContentPartType {
6294 type Error = self::error::ConversionError;
6295 fn try_from(
6296 value: ::std::string::String,
6297 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6298 value.parse()
6299 }
6300}
6301/**Provider-specific opaque data attached to a tool call. The contents are
6302not interpreted by the gateway, but must be echoed back verbatim on the
6303next request that references this tool call. Currently used by Google
6304Gemini extended-thinking models to carry the per-call `thought_signature`.
6305Other providers may ignore the field.
6306*/
6307///
6308/// <details><summary>JSON schema</summary>
6309///
6310/// ```json
6311///{
6312/// "description": "Provider-specific opaque data attached to a tool call. The contents are\nnot interpreted by the gateway, but must be echoed back verbatim on the\nnext request that references this tool call. Currently used by Google\nGemini extended-thinking models to carry the per-call `thought_signature`.\nOther providers may ignore the field.\n",
6313/// "type": "object",
6314/// "properties": {
6315/// "google": {
6316/// "description": "Google Gemini-specific extra content.",
6317/// "type": "object",
6318/// "properties": {
6319/// "thought_signature": {
6320/// "description": "Opaque signature returned with reasoning-enabled tool calls.\nMust be echoed back verbatim in the next request that includes\nthis tool call, or Google will reject the request.\n",
6321/// "type": "string"
6322/// }
6323/// },
6324/// "additionalProperties": true
6325/// }
6326/// }
6327///}
6328/// ```
6329/// </details>
6330#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6331pub struct ToolCallExtraContent {
6332 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6333 pub google: ::std::option::Option<ToolCallExtraContentGoogle>,
6334}
6335impl ::std::default::Default for ToolCallExtraContent {
6336 fn default() -> Self {
6337 Self {
6338 google: Default::default(),
6339 }
6340 }
6341}
6342///Google Gemini-specific extra content.
6343///
6344/// <details><summary>JSON schema</summary>
6345///
6346/// ```json
6347///{
6348/// "description": "Google Gemini-specific extra content.",
6349/// "type": "object",
6350/// "properties": {
6351/// "thought_signature": {
6352/// "description": "Opaque signature returned with reasoning-enabled tool calls.\nMust be echoed back verbatim in the next request that includes\nthis tool call, or Google will reject the request.\n",
6353/// "type": "string"
6354/// }
6355/// },
6356/// "additionalProperties": true
6357///}
6358/// ```
6359/// </details>
6360#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6361pub struct ToolCallExtraContentGoogle {
6362 /**Opaque signature returned with reasoning-enabled tool calls.
6363 Must be echoed back verbatim in the next request that includes
6364 this tool call, or Google will reject the request.
6365 */
6366 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6367 pub thought_signature: ::std::option::Option<::std::string::String>,
6368}
6369impl ::std::default::Default for ToolCallExtraContentGoogle {
6370 fn default() -> Self {
6371 Self {
6372 thought_signature: Default::default(),
6373 }
6374 }
6375}
6376/// Generation of default values for serde.
6377pub mod defaults {
6378 pub(super) fn default_bool<const V: bool>() -> bool {
6379 V
6380 }
6381 pub(super) fn default_i64<T, const V: i64>() -> T
6382 where
6383 T: ::std::convert::TryFrom<i64>,
6384 <T as ::std::convert::TryFrom<i64>>::Error: ::std::fmt::Debug,
6385 {
6386 T::try_from(V).unwrap()
6387 }
6388 pub(super) fn default_nzu64<T, const V: u64>() -> T
6389 where
6390 T: ::std::convert::TryFrom<::std::num::NonZeroU64>,
6391 <T as ::std::convert::TryFrom<::std::num::NonZeroU64>>::Error: ::std::fmt::Debug,
6392 {
6393 T::try_from(::std::num::NonZeroU64::try_from(V).unwrap()).unwrap()
6394 }
6395 pub(super) fn create_chat_completion_request_frequency_penalty() -> f64 {
6396 0_f64
6397 }
6398 pub(super) fn create_chat_completion_request_presence_penalty() -> f64 {
6399 0_f64
6400 }
6401 pub(super) fn create_chat_completion_request_temperature() -> f64 {
6402 1_f64
6403 }
6404 pub(super) fn create_chat_completion_request_top_p() -> f64 {
6405 1_f64
6406 }
6407 pub(super) fn create_response_request_temperature() -> f32 {
6408 1_f32
6409 }
6410 pub(super) fn create_response_request_top_p() -> f32 {
6411 1_f32
6412 }
6413 pub(super) fn image_url_detail() -> super::ImageUrlDetail {
6414 super::ImageUrlDetail::Auto
6415 }
6416 pub(super) fn response_input_image_detail() -> super::ResponseInputImageDetail {
6417 super::ResponseInputImageDetail::Auto
6418 }
6419 pub(super) fn response_input_item_type() -> ::std::string::String {
6420 "message".to_string()
6421 }
6422 pub(super) fn response_reasoning_effort() -> super::ResponseReasoningEffort {
6423 super::ResponseReasoningEffort::Medium
6424 }
6425}