// @generated by defect-llm-codegen — do not edit by hand.
// Source OAS: crates/llm/oas/openai.yaml
// Re-run via `cargo run -p defect-llm-codegen -- openai`.
#![allow(
    clippy::manual_async_fn,
    clippy::needless_return,
    clippy::single_match,
    clippy::match_single_binding,
    clippy::too_many_arguments,
    clippy::large_enum_variant,
    clippy::enum_variant_names,
    dead_code,
    unused_imports,
    rustdoc::bare_urls,
    rustdoc::broken_intra_doc_links
)]

/// # OpenAI API
///
/// The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
///
/// - **Version:** `2.3.0`
/// - **Terms of Service:** <https://openai.com/policies/terms-of-use>
/// - **Contact:** OpenAI Support <https://help.openai.com/>
/// - **License:** MIT <https://github.com/openai/openai-openapi/blob/master/LICENSE>
pub mod spec {}
pub mod components {
    #![allow(deprecated)]
    #![allow(unreachable_patterns)]
    #![allow(non_camel_case_types)]
    #![allow(non_snake_case)]
    #![allow(clippy::all, clippy::pedantic)]
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionStreamResponseDeltaContent {
        ChatCompletionStreamResponseDeltaContentVariant0(String),
        ChatCompletionStreamResponseDeltaContentVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionStreamResponseDeltaContent {
        fn from(value: String) -> Self {
            ChatCompletionStreamResponseDeltaContent::ChatCompletionStreamResponseDeltaContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamResponseDeltaContent> for String {
        type Error = ChatCompletionStreamResponseDeltaContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamResponseDeltaContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamResponseDeltaContent::ChatCompletionStreamResponseDeltaContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionStreamResponseDeltaContent
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionStreamResponseDeltaContent::ChatCompletionStreamResponseDeltaContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamResponseDeltaContent>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionStreamResponseDeltaContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamResponseDeltaContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamResponseDeltaContent::ChatCompletionStreamResponseDeltaContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[deprecated]
    /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
    pub struct ChatCompletionStreamResponseDeltaFunctionCall {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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.
        pub arguments: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The name of the function to call.
        pub name: Option<String>,
    }
    /// The type of the tool. Currently, only `function` is supported.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionMessageToolCallChunkType {
        #[serde(rename = "function")]
        Function,
    }
    impl ::std::fmt::Display for ChatCompletionMessageToolCallChunkType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Function => ::std::write!(__f, "function"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionMessageToolCallChunkFunction {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The name of the function to call.
        pub name: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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.
        pub arguments: Option<String>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionMessageToolCallChunk {
        pub index: i64,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The ID of the tool call.
        pub id: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The type of the tool. Currently, only `function` is supported.
        pub r#type: Option<ChatCompletionMessageToolCallChunkType>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub function: Option<ChatCompletionMessageToolCallChunkFunction>,
    }
    /// The role of the author of this message.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionStreamResponseDeltaRole {
        #[serde(rename = "developer")]
        Developer,
        #[serde(rename = "system")]
        System,
        #[serde(rename = "user")]
        User,
        #[serde(rename = "assistant")]
        Assistant,
        #[serde(rename = "tool")]
        Tool,
    }
    impl ::std::fmt::Display for ChatCompletionStreamResponseDeltaRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Developer => ::std::write!(__f, "developer"),
                Self::System => ::std::write!(__f, "system"),
                Self::User => ::std::write!(__f, "user"),
                Self::Assistant => ::std::write!(__f, "assistant"),
                Self::Tool => ::std::write!(__f, "tool"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionStreamResponseDeltaRefusal {
        ChatCompletionStreamResponseDeltaRefusalVariant0(String),
        ChatCompletionStreamResponseDeltaRefusalVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionStreamResponseDeltaRefusal {
        fn from(value: String) -> Self {
            ChatCompletionStreamResponseDeltaRefusal::ChatCompletionStreamResponseDeltaRefusalVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamResponseDeltaRefusal> for String {
        type Error = ChatCompletionStreamResponseDeltaRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamResponseDeltaRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamResponseDeltaRefusal::ChatCompletionStreamResponseDeltaRefusalVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionStreamResponseDeltaRefusal
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionStreamResponseDeltaRefusal::ChatCompletionStreamResponseDeltaRefusalVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamResponseDeltaRefusal>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionStreamResponseDeltaRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamResponseDeltaRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamResponseDeltaRefusal::ChatCompletionStreamResponseDeltaRefusalVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// A chat completion delta generated by streamed model responses.
    pub struct ChatCompletionStreamResponseDelta {
        #[serde(skip_serializing_if = "Option::is_none")]
        pub content: Option<ChatCompletionStreamResponseDeltaContent>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
        #[deprecated]
        pub function_call: Option<ChatCompletionStreamResponseDeltaFunctionCall>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The role of the author of this message.
        pub role: Option<ChatCompletionStreamResponseDeltaRole>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub refusal: Option<ChatCompletionStreamResponseDeltaRefusal>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionTokenLogprobBytes {
        ChatCompletionTokenLogprobBytesVariant0(Vec<i64>),
        ChatCompletionTokenLogprobBytesVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<Vec<i64>> for ChatCompletionTokenLogprobBytes {
        fn from(value: Vec<i64>) -> Self {
            ChatCompletionTokenLogprobBytes::ChatCompletionTokenLogprobBytesVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionTokenLogprobBytes> for Vec<i64> {
        type Error = ChatCompletionTokenLogprobBytes;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionTokenLogprobBytes,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionTokenLogprobBytes::ChatCompletionTokenLogprobBytesVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ChatCompletionTokenLogprobBytes {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionTokenLogprobBytes::ChatCompletionTokenLogprobBytesVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionTokenLogprobBytes> for Option<::serde_json::Value> {
        type Error = ChatCompletionTokenLogprobBytes;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionTokenLogprobBytes,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionTokenLogprobBytes::ChatCompletionTokenLogprobBytesVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionTokenLogprobTopLogprobsBytes {
        ChatCompletionTokenLogprobTopLogprobsBytesVariant0(Vec<i64>),
        ChatCompletionTokenLogprobTopLogprobsBytesVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<Vec<i64>> for ChatCompletionTokenLogprobTopLogprobsBytes {
        fn from(value: Vec<i64>) -> Self {
            ChatCompletionTokenLogprobTopLogprobsBytes::ChatCompletionTokenLogprobTopLogprobsBytesVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionTokenLogprobTopLogprobsBytes> for Vec<i64> {
        type Error = ChatCompletionTokenLogprobTopLogprobsBytes;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionTokenLogprobTopLogprobsBytes,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionTokenLogprobTopLogprobsBytes::ChatCompletionTokenLogprobTopLogprobsBytesVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionTokenLogprobTopLogprobsBytes
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionTokenLogprobTopLogprobsBytes::ChatCompletionTokenLogprobTopLogprobsBytesVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionTokenLogprobTopLogprobsBytes>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionTokenLogprobTopLogprobsBytes;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionTokenLogprobTopLogprobsBytes,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionTokenLogprobTopLogprobsBytes::ChatCompletionTokenLogprobTopLogprobsBytesVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionTokenLogprobTopLogprobs {
        /// The token.
        pub token: String,
        /// 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.
        pub logprob: f64,
        pub bytes: ChatCompletionTokenLogprobTopLogprobsBytes,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionTokenLogprob {
        /// The token.
        pub token: String,
        /// 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.
        pub logprob: f64,
        pub bytes: ChatCompletionTokenLogprobBytes,
        /// List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`.
        pub top_logprobs: Vec<ChatCompletionTokenLogprobTopLogprobs>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Log probability information for the choice.
    pub struct CreateChatCompletionStreamResponseChoicesLogprobs {
        /// A list of message content tokens with log probability information.
        pub content: Vec<ChatCompletionTokenLogprob>,
        /// A list of message refusal tokens with log probability information.
        pub refusal: Vec<ChatCompletionTokenLogprob>,
    }
    /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
    /// `length` if the maximum number of tokens specified in the request was reached,
    /// `content_filter` if content was omitted due to a flag from our content filters,
    /// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionStreamResponseChoicesFinishReason {
        #[serde(rename = "stop")]
        Stop,
        #[serde(rename = "length")]
        Length,
        #[serde(rename = "tool_calls")]
        ToolCalls,
        #[serde(rename = "content_filter")]
        ContentFilter,
        #[serde(rename = "function_call")]
        FunctionCall,
    }
    impl ::std::fmt::Display for CreateChatCompletionStreamResponseChoicesFinishReason {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Stop => ::std::write!(__f, "stop"),
                Self::Length => ::std::write!(__f, "length"),
                Self::ToolCalls => ::std::write!(__f, "tool_calls"),
                Self::ContentFilter => ::std::write!(__f, "content_filter"),
                Self::FunctionCall => ::std::write!(__f, "function_call"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct CreateChatCompletionStreamResponseChoices {
        pub delta: ChatCompletionStreamResponseDelta,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Log probability information for the choice.
        pub logprobs: Option<CreateChatCompletionStreamResponseChoicesLogprobs>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
        /// `length` if the maximum number of tokens specified in the request was reached,
        /// `content_filter` if content was omitted due to a flag from our content filters,
        /// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
        pub finish_reason: Option<CreateChatCompletionStreamResponseChoicesFinishReason>,
        /// The index of the choice in the list of choices.
        pub index: i64,
    }
    /// Specifies the processing type used for serving the request.
    ///   - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
    ///   - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
    ///   - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.
    ///   - When not set, the default behavior is 'auto'.
    ///
    ///   When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ServiceTierVariant0 {
        #[serde(rename = "auto")]
        Auto,
        #[serde(rename = "default")]
        Default,
        #[serde(rename = "flex")]
        Flex,
        #[serde(rename = "scale")]
        Scale,
        #[serde(rename = "priority")]
        Priority,
    }
    impl ::std::fmt::Display for ServiceTierVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Auto => ::std::write!(__f, "auto"),
                Self::Default => ::std::write!(__f, "default"),
                Self::Flex => ::std::write!(__f, "flex"),
                Self::Scale => ::std::write!(__f, "scale"),
                Self::Priority => ::std::write!(__f, "priority"),
            }
        }
    }
    impl ::std::convert::From<ServiceTierVariant0> for ServiceTier {
        fn from(value: ServiceTierVariant0) -> Self {
            ServiceTier::ServiceTierVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ServiceTier> for ServiceTierVariant0 {
        type Error = ServiceTier;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ServiceTier) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ServiceTier::ServiceTierVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ServiceTier {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ServiceTier::ServiceTierVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ServiceTier> for Option<::serde_json::Value> {
        type Error = ServiceTier;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ServiceTier) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ServiceTier::ServiceTierVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ServiceTier {
        ServiceTierVariant0(ServiceTierVariant0),
        ServiceTierVariant1(Option<::serde_json::Value>),
    }
    /// The object type, which is always `chat.completion.chunk`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionStreamResponseObject {
        #[serde(rename = "chat.completion.chunk")]
        ChatCompletionChunk,
    }
    impl ::std::fmt::Display for CreateChatCompletionStreamResponseObject {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::ChatCompletionChunk => ::std::write!(__f, "chat.completion.chunk"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Breakdown of tokens used in a completion.
    pub struct CompletionUsageCompletionTokensDetails {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// When using Predicted Outputs, the number of tokens in the
        /// prediction that appeared in the completion.
        pub accepted_prediction_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Audio input tokens generated by the model.
        pub audio_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Tokens generated by the model for reasoning.
        pub reasoning_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// When using Predicted Outputs, the number of tokens in the
        /// prediction that did not appear in the completion. However, like
        /// reasoning tokens, these tokens are still counted in the total
        /// completion tokens for purposes of billing, output, and context window
        /// limits.
        pub rejected_prediction_tokens: Option<i64>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Breakdown of tokens used in the prompt.
    pub struct CompletionUsagePromptTokensDetails {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Audio input tokens present in the prompt.
        pub audio_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Cached tokens present in the prompt.
        pub cached_tokens: Option<i64>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Usage statistics for the completion request.
    pub struct CompletionUsage {
        /// Number of tokens in the generated completion.
        pub completion_tokens: i64,
        /// Number of tokens in the prompt.
        pub prompt_tokens: i64,
        /// Total number of tokens used in the request (prompt + completion).
        pub total_tokens: i64,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Breakdown of tokens used in a completion.
        pub completion_tokens_details: Option<CompletionUsageCompletionTokensDetails>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Breakdown of tokens used in the prompt.
        pub prompt_tokens_details: Option<CompletionUsagePromptTokensDetails>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Represents a streamed chunk of a chat completion response returned
    /// by the model, based on the provided input.
    /// [Learn more](/docs/guides/streaming-responses).
    pub struct CreateChatCompletionStreamResponse {
        /// A unique identifier for the chat completion. Each chunk has the same ID.
        pub id: String,
        /// A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the
        /// last chunk if you set `stream_options: {"include_usage": true}`.
        pub choices: Vec<CreateChatCompletionStreamResponseChoices>,
        /// The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
        pub created: i64,
        /// The model to generate the completion.
        pub model: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub service_tier: Option<ServiceTier>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This fingerprint represents the backend configuration that the model runs with.
        /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
        #[deprecated]
        pub system_fingerprint: Option<String>,
        /// The object type, which is always `chat.completion.chunk`.
        pub object: CreateChatCompletionStreamResponseObject,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub usage: Option<CompletionUsage>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Options for streaming response. Only set this when you set `stream: true`.
    pub struct ChatCompletionStreamOptionsVariant0 {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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. **NOTE:** If the stream is interrupted, you may not receive the
        /// final usage chunk which contains the total token usage for the request.
        pub include_usage: Option<bool>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// When true, stream obfuscation will be enabled. Stream obfuscation adds
        /// random characters to an `obfuscation` field on streaming delta events to
        /// normalize payload sizes as a mitigation to certain side-channel attacks.
        /// These obfuscation fields are included by default, but add a small amount
        /// of overhead to the data stream. You can set `include_obfuscation` to
        /// false to optimize for bandwidth if you trust the network links between
        /// your application and the OpenAI API.
        pub include_obfuscation: Option<bool>,
    }
    impl ::std::convert::From<ChatCompletionStreamOptionsVariant0> for ChatCompletionStreamOptions {
        fn from(value: ChatCompletionStreamOptionsVariant0) -> Self {
            ChatCompletionStreamOptions::ChatCompletionStreamOptionsVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamOptions> for ChatCompletionStreamOptionsVariant0 {
        type Error = ChatCompletionStreamOptions;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamOptions,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamOptions::ChatCompletionStreamOptionsVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ChatCompletionStreamOptions {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionStreamOptions::ChatCompletionStreamOptionsVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionStreamOptions> for Option<::serde_json::Value> {
        type Error = ChatCompletionStreamOptions;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionStreamOptions,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionStreamOptions::ChatCompletionStreamOptionsVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionStreamOptions {
        ChatCompletionStreamOptionsVariant0(ChatCompletionStreamOptionsVariant0),
        ChatCompletionStreamOptionsVariant1(Option<::serde_json::Value>),
    }
    /// The type of the tool. Currently, only `function` is supported.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionToolType {
        #[serde(rename = "function")]
        Function,
    }
    impl ::std::fmt::Display for ChatCompletionToolType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Function => ::std::write!(__f, "function"),
            }
        }
    }
    /// 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.
    ///
    /// Omitting `parameters` defines a function with an empty parameter list.
    pub type FunctionParameters = ::std::collections::BTreeMap<String, ::serde_json::Value>;
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum FunctionObjectStrict {
        FunctionObjectStrictVariant0(bool),
        FunctionObjectStrictVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<bool> for FunctionObjectStrict {
        fn from(value: bool) -> Self {
            FunctionObjectStrict::FunctionObjectStrictVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<FunctionObjectStrict> for bool {
        type Error = FunctionObjectStrict;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: FunctionObjectStrict) -> ::std::result::Result<Self, Self::Error> {
            match value {
                FunctionObjectStrict::FunctionObjectStrictVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for FunctionObjectStrict {
        fn from(value: Option<::serde_json::Value>) -> Self {
            FunctionObjectStrict::FunctionObjectStrictVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<FunctionObjectStrict> for Option<::serde_json::Value> {
        type Error = FunctionObjectStrict;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: FunctionObjectStrict) -> ::std::result::Result<Self, Self::Error> {
            match value {
                FunctionObjectStrict::FunctionObjectStrictVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct FunctionObject {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A description of what the function does, used by the model to choose when and how to call the function.
        pub description: Option<String>,
        /// 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.
        pub name: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub parameters: Option<FunctionParameters>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub strict: Option<FunctionObjectStrict>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Function tool
    /// A function tool that can be used to generate a response.
    pub struct ChatCompletionTool {
        /// The type of the tool. Currently, only `function` is supported.
        pub r#type: ChatCompletionToolType,
        pub function: FunctionObject,
    }
    /// # Tool choice mode
    /// `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.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionToolChoiceOptionVariant0 {
        #[serde(rename = "none")]
        None,
        #[serde(rename = "auto")]
        Auto,
        #[serde(rename = "required")]
        Required,
    }
    impl ::std::fmt::Display for ChatCompletionToolChoiceOptionVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::None => ::std::write!(__f, "none"),
                Self::Auto => ::std::write!(__f, "auto"),
                Self::Required => ::std::write!(__f, "required"),
            }
        }
    }
    /// Allowed tool configuration type. Always `allowed_tools`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionAllowedToolsChoiceType {
        #[serde(rename = "allowed_tools")]
        AllowedTools,
    }
    impl ::std::fmt::Display for ChatCompletionAllowedToolsChoiceType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::AllowedTools => ::std::write!(__f, "allowed_tools"),
            }
        }
    }
    /// Constrains the tools available to the model to a pre-defined set.
    ///
    /// `auto` allows the model to pick from among the allowed tools and generate a
    /// message.
    ///
    /// `required` requires the model to call one or more of the allowed tools.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionAllowedToolsMode {
        #[serde(rename = "auto")]
        Auto,
        #[serde(rename = "required")]
        Required,
    }
    impl ::std::fmt::Display for ChatCompletionAllowedToolsMode {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Auto => ::std::write!(__f, "auto"),
                Self::Required => ::std::write!(__f, "required"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Allowed tools
    /// Constrains the tools available to the model to a pre-defined set.
    pub struct ChatCompletionAllowedTools {
        /// Constrains the tools available to the model to a pre-defined set.
        ///
        /// `auto` allows the model to pick from among the allowed tools and generate a
        /// message.
        ///
        /// `required` requires the model to call one or more of the allowed tools.
        pub mode: ChatCompletionAllowedToolsMode,
        /// A list of tool definitions that the model should be allowed to call.
        ///
        /// For the Chat Completions API, the list of tool definitions might look like:
        /// ```json
        /// [
        ///   { "type": "function", "function": { "name": "get_weather" } },
        ///   { "type": "function", "function": { "name": "get_time" } }
        /// ]
        /// ```
        pub tools: Vec<::std::collections::BTreeMap<String, ::serde_json::Value>>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Allowed tools
    /// Constrains the tools available to the model to a pre-defined set.
    pub struct ChatCompletionAllowedToolsChoice {
        /// Allowed tool configuration type. Always `allowed_tools`.
        pub r#type: ChatCompletionAllowedToolsChoiceType,
        pub allowed_tools: ChatCompletionAllowedTools,
    }
    /// For function calling, the type is always `function`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionNamedToolChoiceType {
        #[serde(rename = "function")]
        Function,
    }
    impl ::std::fmt::Display for ChatCompletionNamedToolChoiceType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Function => ::std::write!(__f, "function"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionNamedToolChoiceFunction {
        /// The name of the function to call.
        pub name: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Function tool choice
    /// Specifies a tool the model should use. Use to force the model to call a specific function.
    pub struct ChatCompletionNamedToolChoice {
        /// For function calling, the type is always `function`.
        pub r#type: ChatCompletionNamedToolChoiceType,
        pub function: ChatCompletionNamedToolChoiceFunction,
    }
    /// For custom tool calling, the type is always `custom`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionNamedToolChoiceCustomType {
        #[serde(rename = "custom")]
        Custom,
    }
    impl ::std::fmt::Display for ChatCompletionNamedToolChoiceCustomType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Custom => ::std::write!(__f, "custom"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionNamedToolChoiceCustomCustom {
        /// The name of the custom tool to call.
        pub name: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Custom tool choice
    /// Specifies a tool the model should use. Use to force the model to call a specific custom tool.
    pub struct ChatCompletionNamedToolChoiceCustom {
        /// For custom tool calling, the type is always `custom`.
        pub r#type: ChatCompletionNamedToolChoiceCustomType,
        pub custom: ChatCompletionNamedToolChoiceCustomCustom,
    }
    impl ::std::convert::From<ChatCompletionToolChoiceOptionVariant0>
        for ChatCompletionToolChoiceOption
    {
        fn from(value: ChatCompletionToolChoiceOptionVariant0) -> Self {
            ChatCompletionToolChoiceOption::ChatCompletionToolChoiceOptionVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionToolChoiceOption>
        for ChatCompletionToolChoiceOptionVariant0
    {
        type Error = ChatCompletionToolChoiceOption;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionToolChoiceOption,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionToolChoiceOption::ChatCompletionToolChoiceOptionVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionAllowedToolsChoice> for ChatCompletionToolChoiceOption {
        fn from(value: ChatCompletionAllowedToolsChoice) -> Self {
            ChatCompletionToolChoiceOption::ChatCompletionAllowedToolsChoice(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionToolChoiceOption> for ChatCompletionAllowedToolsChoice {
        type Error = ChatCompletionToolChoiceOption;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionToolChoiceOption,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionToolChoiceOption::ChatCompletionAllowedToolsChoice(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionNamedToolChoice> for ChatCompletionToolChoiceOption {
        fn from(value: ChatCompletionNamedToolChoice) -> Self {
            ChatCompletionToolChoiceOption::ChatCompletionNamedToolChoice(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionToolChoiceOption> for ChatCompletionNamedToolChoice {
        type Error = ChatCompletionToolChoiceOption;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionToolChoiceOption,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionToolChoiceOption::ChatCompletionNamedToolChoice(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionNamedToolChoiceCustom> for ChatCompletionToolChoiceOption {
        fn from(value: ChatCompletionNamedToolChoiceCustom) -> Self {
            ChatCompletionToolChoiceOption::ChatCompletionNamedToolChoiceCustom(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionToolChoiceOption>
        for ChatCompletionNamedToolChoiceCustom
    {
        type Error = ChatCompletionToolChoiceOption;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionToolChoiceOption,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionToolChoiceOption::ChatCompletionNamedToolChoiceCustom(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// 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.
    ///
    /// `none` is the default when no tools are present. `auto` is the default if tools are present.
    pub enum ChatCompletionToolChoiceOption {
        ChatCompletionToolChoiceOptionVariant0(ChatCompletionToolChoiceOptionVariant0),
        ChatCompletionAllowedToolsChoice(ChatCompletionAllowedToolsChoice),
        ChatCompletionNamedToolChoice(ChatCompletionNamedToolChoice),
        ChatCompletionNamedToolChoiceCustom(ChatCompletionNamedToolChoiceCustom),
    }
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum VoiceIdsSharedVariant1 {
        #[serde(rename = "alloy")]
        Alloy,
        #[serde(rename = "ash")]
        Ash,
        #[serde(rename = "ballad")]
        Ballad,
        #[serde(rename = "coral")]
        Coral,
        #[serde(rename = "echo")]
        Echo,
        #[serde(rename = "sage")]
        Sage,
        #[serde(rename = "shimmer")]
        Shimmer,
        #[serde(rename = "verse")]
        Verse,
        #[serde(rename = "marin")]
        Marin,
        #[serde(rename = "cedar")]
        Cedar,
    }
    impl ::std::fmt::Display for VoiceIdsSharedVariant1 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Alloy => ::std::write!(__f, "alloy"),
                Self::Ash => ::std::write!(__f, "ash"),
                Self::Ballad => ::std::write!(__f, "ballad"),
                Self::Coral => ::std::write!(__f, "coral"),
                Self::Echo => ::std::write!(__f, "echo"),
                Self::Sage => ::std::write!(__f, "sage"),
                Self::Shimmer => ::std::write!(__f, "shimmer"),
                Self::Verse => ::std::write!(__f, "verse"),
                Self::Marin => ::std::write!(__f, "marin"),
                Self::Cedar => ::std::write!(__f, "cedar"),
            }
        }
    }
    impl ::std::convert::From<String> for VoiceIdsShared {
        fn from(value: String) -> Self {
            VoiceIdsShared::VoiceIdsSharedVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<VoiceIdsShared> for String {
        type Error = VoiceIdsShared;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: VoiceIdsShared) -> ::std::result::Result<Self, Self::Error> {
            match value {
                VoiceIdsShared::VoiceIdsSharedVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<VoiceIdsSharedVariant1> for VoiceIdsShared {
        fn from(value: VoiceIdsSharedVariant1) -> Self {
            VoiceIdsShared::VoiceIdsSharedVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<VoiceIdsShared> for VoiceIdsSharedVariant1 {
        type Error = VoiceIdsShared;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: VoiceIdsShared) -> ::std::result::Result<Self, Self::Error> {
            match value {
                VoiceIdsShared::VoiceIdsSharedVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum VoiceIdsShared {
        VoiceIdsSharedVariant0(String),
        VoiceIdsSharedVariant1(VoiceIdsSharedVariant1),
    }
    impl ::std::convert::From<::std::collections::BTreeMap<String, String>> for Metadata {
        fn from(value: ::std::collections::BTreeMap<String, String>) -> Self {
            Metadata::MetadataVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<Metadata> for ::std::collections::BTreeMap<String, String> {
        type Error = Metadata;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: Metadata) -> ::std::result::Result<Self, Self::Error> {
            match value {
                Metadata::MetadataVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for Metadata {
        fn from(value: Option<::serde_json::Value>) -> Self {
            Metadata::MetadataVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<Metadata> for Option<::serde_json::Value> {
        type Error = Metadata;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: Metadata) -> ::std::result::Result<Self, Self::Error> {
            match value {
                Metadata::MetadataVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum Metadata {
        MetadataVariant0(::std::collections::BTreeMap<String, String>),
        MetadataVariant1(Option<::serde_json::Value>),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateModelResponsePropertiesTopLogprobs {
        CreateModelResponsePropertiesTopLogprobsVariant0(i64),
        CreateModelResponsePropertiesTopLogprobsVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<i64> for CreateModelResponsePropertiesTopLogprobs {
        fn from(value: i64) -> Self {
            CreateModelResponsePropertiesTopLogprobs::CreateModelResponsePropertiesTopLogprobsVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTopLogprobs> for i64 {
        type Error = CreateModelResponsePropertiesTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTopLogprobs::CreateModelResponsePropertiesTopLogprobsVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateModelResponsePropertiesTopLogprobs
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateModelResponsePropertiesTopLogprobs::CreateModelResponsePropertiesTopLogprobsVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTopLogprobs>
        for Option<::serde_json::Value>
    {
        type Error = CreateModelResponsePropertiesTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTopLogprobs::CreateModelResponsePropertiesTopLogprobsVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateModelResponsePropertiesTemperature {
        CreateModelResponsePropertiesTemperatureVariant0(f64),
        CreateModelResponsePropertiesTemperatureVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for CreateModelResponsePropertiesTemperature {
        fn from(value: f64) -> Self {
            CreateModelResponsePropertiesTemperature::CreateModelResponsePropertiesTemperatureVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTemperature> for f64 {
        type Error = CreateModelResponsePropertiesTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTemperature::CreateModelResponsePropertiesTemperatureVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateModelResponsePropertiesTemperature
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateModelResponsePropertiesTemperature::CreateModelResponsePropertiesTemperatureVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTemperature>
        for Option<::serde_json::Value>
    {
        type Error = CreateModelResponsePropertiesTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTemperature::CreateModelResponsePropertiesTemperatureVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateModelResponsePropertiesTopP {
        CreateModelResponsePropertiesTopPVariant0(f64),
        CreateModelResponsePropertiesTopPVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for CreateModelResponsePropertiesTopP {
        fn from(value: f64) -> Self {
            CreateModelResponsePropertiesTopP::CreateModelResponsePropertiesTopPVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTopP> for f64 {
        type Error = CreateModelResponsePropertiesTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTopP::CreateModelResponsePropertiesTopPVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for CreateModelResponsePropertiesTopP {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateModelResponsePropertiesTopP::CreateModelResponsePropertiesTopPVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesTopP> for Option<::serde_json::Value> {
        type Error = CreateModelResponsePropertiesTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesTopP::CreateModelResponsePropertiesTopPVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention).
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateModelResponsePropertiesPromptCacheRetentionVariant0 {
        #[serde(rename = "in_memory")]
        InMemory,
        #[serde(rename = "24h")]
        _24h,
    }
    impl ::std::fmt::Display for CreateModelResponsePropertiesPromptCacheRetentionVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::InMemory => ::std::write!(__f, "in_memory"),
                Self::_24h => ::std::write!(__f, "24h"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateModelResponsePropertiesPromptCacheRetention {
        CreateModelResponsePropertiesPromptCacheRetentionVariant0(
            CreateModelResponsePropertiesPromptCacheRetentionVariant0,
        ),
        CreateModelResponsePropertiesPromptCacheRetentionVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<CreateModelResponsePropertiesPromptCacheRetentionVariant0>
        for CreateModelResponsePropertiesPromptCacheRetention
    {
        fn from(value: CreateModelResponsePropertiesPromptCacheRetentionVariant0) -> Self {
            CreateModelResponsePropertiesPromptCacheRetention::CreateModelResponsePropertiesPromptCacheRetentionVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesPromptCacheRetention>
        for CreateModelResponsePropertiesPromptCacheRetentionVariant0
    {
        type Error = CreateModelResponsePropertiesPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesPromptCacheRetention::CreateModelResponsePropertiesPromptCacheRetentionVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateModelResponsePropertiesPromptCacheRetention
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateModelResponsePropertiesPromptCacheRetention::CreateModelResponsePropertiesPromptCacheRetentionVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateModelResponsePropertiesPromptCacheRetention>
        for Option<::serde_json::Value>
    {
        type Error = CreateModelResponsePropertiesPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateModelResponsePropertiesPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateModelResponsePropertiesPromptCacheRetention::CreateModelResponsePropertiesPromptCacheRetentionVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct CreateModelResponseProperties {
        #[serde(skip_serializing_if = "Option::is_none")]
        pub metadata: Option<Metadata>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_logprobs: Option<CreateModelResponsePropertiesTopLogprobs>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub temperature: Option<CreateModelResponsePropertiesTemperature>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_p: Option<CreateModelResponsePropertiesTopP>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.
        /// A stable identifier for your end-users.
        /// Used to boost cache hit rates by better bucketing similar requests and  to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        #[deprecated]
        pub user: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
        /// The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        pub safety_identifier: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
        pub prompt_cache_key: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub service_tier: Option<ServiceTier>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub prompt_cache_retention: Option<CreateModelResponsePropertiesPromptCacheRetention>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Custom voice reference.
    pub struct VoiceIdsOrCustomVoiceVariant1 {
        /// The custom voice ID, e.g. `voice_1234`.
        pub id: String,
    }
    impl ::std::convert::From<VoiceIdsShared> for VoiceIdsOrCustomVoice {
        fn from(value: VoiceIdsShared) -> Self {
            VoiceIdsOrCustomVoice::VoiceIdsShared(value)
        }
    }
    impl ::std::convert::TryFrom<VoiceIdsOrCustomVoice> for VoiceIdsShared {
        type Error = VoiceIdsOrCustomVoice;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: VoiceIdsOrCustomVoice) -> ::std::result::Result<Self, Self::Error> {
            match value {
                VoiceIdsOrCustomVoice::VoiceIdsShared(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<VoiceIdsOrCustomVoiceVariant1> for VoiceIdsOrCustomVoice {
        fn from(value: VoiceIdsOrCustomVoiceVariant1) -> Self {
            VoiceIdsOrCustomVoice::VoiceIdsOrCustomVoiceVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<VoiceIdsOrCustomVoice> for VoiceIdsOrCustomVoiceVariant1 {
        type Error = VoiceIdsOrCustomVoice;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: VoiceIdsOrCustomVoice) -> ::std::result::Result<Self, Self::Error> {
            match value {
                VoiceIdsOrCustomVoice::VoiceIdsOrCustomVoiceVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// # Voice
    /// A built-in voice name or a custom voice reference.
    pub enum VoiceIdsOrCustomVoice {
        VoiceIdsShared(VoiceIdsShared),
        VoiceIdsOrCustomVoiceVariant1(VoiceIdsOrCustomVoiceVariant1),
    }
    /// The type of the custom tool. Always `custom`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CustomToolChatCompletionsType {
        #[serde(rename = "custom")]
        Custom,
    }
    impl ::std::fmt::Display for CustomToolChatCompletionsType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Custom => ::std::write!(__f, "custom"),
            }
        }
    }
    /// Unconstrained text format. Always `text`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CustomToolChatCompletionsCustomFormatVariant0Type {
        #[serde(rename = "text")]
        Text,
    }
    impl ::std::fmt::Display for CustomToolChatCompletionsCustomFormatVariant0Type {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Text => ::std::write!(__f, "text"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Text format
    /// Unconstrained free-form text.
    pub struct CustomToolChatCompletionsCustomFormatVariant0 {
        /// Unconstrained text format. Always `text`.
        pub r#type: CustomToolChatCompletionsCustomFormatVariant0Type,
    }
    /// Grammar format. Always `grammar`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CustomToolChatCompletionsCustomFormatVariant1Type {
        #[serde(rename = "grammar")]
        Grammar,
    }
    impl ::std::fmt::Display for CustomToolChatCompletionsCustomFormatVariant1Type {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Grammar => ::std::write!(__f, "grammar"),
            }
        }
    }
    /// The syntax of the grammar definition. One of `lark` or `regex`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CustomToolChatCompletionsCustomFormatVariant1GrammarSyntax {
        #[serde(rename = "lark")]
        Lark,
        #[serde(rename = "regex")]
        Regex,
    }
    impl ::std::fmt::Display for CustomToolChatCompletionsCustomFormatVariant1GrammarSyntax {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Lark => ::std::write!(__f, "lark"),
                Self::Regex => ::std::write!(__f, "regex"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Grammar format
    /// Your chosen grammar.
    pub struct CustomToolChatCompletionsCustomFormatVariant1Grammar {
        /// The grammar definition.
        pub definition: String,
        /// The syntax of the grammar definition. One of `lark` or `regex`.
        pub syntax: CustomToolChatCompletionsCustomFormatVariant1GrammarSyntax,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Grammar format
    /// A grammar defined by the user.
    pub struct CustomToolChatCompletionsCustomFormatVariant1 {
        /// Grammar format. Always `grammar`.
        pub r#type: CustomToolChatCompletionsCustomFormatVariant1Type,
        /// Your chosen grammar.
        pub grammar: CustomToolChatCompletionsCustomFormatVariant1Grammar,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The input format for the custom tool. Default is unconstrained text.
    pub enum CustomToolChatCompletionsCustomFormat {
        CustomToolChatCompletionsCustomFormatVariant0(
            CustomToolChatCompletionsCustomFormatVariant0,
        ),
        CustomToolChatCompletionsCustomFormatVariant1(
            CustomToolChatCompletionsCustomFormatVariant1,
        ),
    }
    impl ::std::convert::From<CustomToolChatCompletionsCustomFormatVariant0>
        for CustomToolChatCompletionsCustomFormat
    {
        fn from(value: CustomToolChatCompletionsCustomFormatVariant0) -> Self {
            CustomToolChatCompletionsCustomFormat::CustomToolChatCompletionsCustomFormatVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CustomToolChatCompletionsCustomFormat>
        for CustomToolChatCompletionsCustomFormatVariant0
    {
        type Error = CustomToolChatCompletionsCustomFormat;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CustomToolChatCompletionsCustomFormat,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CustomToolChatCompletionsCustomFormat::CustomToolChatCompletionsCustomFormatVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<CustomToolChatCompletionsCustomFormatVariant1>
        for CustomToolChatCompletionsCustomFormat
    {
        fn from(value: CustomToolChatCompletionsCustomFormatVariant1) -> Self {
            CustomToolChatCompletionsCustomFormat::CustomToolChatCompletionsCustomFormatVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CustomToolChatCompletionsCustomFormat>
        for CustomToolChatCompletionsCustomFormatVariant1
    {
        type Error = CustomToolChatCompletionsCustomFormat;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CustomToolChatCompletionsCustomFormat,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CustomToolChatCompletionsCustomFormat::CustomToolChatCompletionsCustomFormatVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Custom tool properties
    /// Properties of the custom tool.
    pub struct CustomToolChatCompletionsCustom {
        /// The name of the custom tool, used to identify it in tool calls.
        pub name: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Optional description of the custom tool, used to provide more context.
        pub description: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The input format for the custom tool. Default is unconstrained text.
        pub format: Option<CustomToolChatCompletionsCustomFormat>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Custom tool
    /// A custom tool that processes input using a specified format.
    pub struct CustomToolChatCompletions {
        /// The type of the custom tool. Always `custom`.
        pub r#type: CustomToolChatCompletionsType,
        /// Properties of the custom tool.
        pub custom: CustomToolChatCompletionsCustom,
    }
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ModelIdsSharedVariant1 {
        #[serde(rename = "gpt-5.4")]
        Gpt54,
        #[serde(rename = "gpt-5.4-mini")]
        Gpt54Mini,
        #[serde(rename = "gpt-5.4-nano")]
        Gpt54Nano,
        #[serde(rename = "gpt-5.4-mini-2026-03-17")]
        Gpt54Mini2026Minus03Minus17,
        #[serde(rename = "gpt-5.4-nano-2026-03-17")]
        Gpt54Nano2026Minus03Minus17,
        #[serde(rename = "gpt-5.3-chat-latest")]
        Gpt53ChatLatest,
        #[serde(rename = "gpt-5.2")]
        Gpt52,
        #[serde(rename = "gpt-5.2-2025-12-11")]
        Gpt52Minus2025Minus12Minus11,
        #[serde(rename = "gpt-5.2-chat-latest")]
        Gpt52ChatLatest,
        #[serde(rename = "gpt-5.2-pro")]
        Gpt52Pro,
        #[serde(rename = "gpt-5.2-pro-2025-12-11")]
        Gpt52Pro2025Minus12Minus11,
        #[serde(rename = "gpt-5.1")]
        Gpt51,
        #[serde(rename = "gpt-5.1-2025-11-13")]
        Gpt51Minus2025Minus11Minus13,
        #[serde(rename = "gpt-5.1-codex")]
        Gpt51Codex,
        #[serde(rename = "gpt-5.1-mini")]
        Gpt51Mini,
        #[serde(rename = "gpt-5.1-chat-latest")]
        Gpt51ChatLatest,
        #[serde(rename = "gpt-5")]
        Gpt5,
        #[serde(rename = "gpt-5-mini")]
        Gpt5Mini,
        #[serde(rename = "gpt-5-nano")]
        Gpt5Nano,
        #[serde(rename = "gpt-5-2025-08-07")]
        Gpt5Minus2025Minus08Minus07,
        #[serde(rename = "gpt-5-mini-2025-08-07")]
        Gpt5Mini2025Minus08Minus07,
        #[serde(rename = "gpt-5-nano-2025-08-07")]
        Gpt5Nano2025Minus08Minus07,
        #[serde(rename = "gpt-5-chat-latest")]
        Gpt5ChatLatest,
        #[serde(rename = "gpt-4.1")]
        Gpt41,
        #[serde(rename = "gpt-4.1-mini")]
        Gpt41Mini,
        #[serde(rename = "gpt-4.1-nano")]
        Gpt41Nano,
        #[serde(rename = "gpt-4.1-2025-04-14")]
        Gpt41Minus2025Minus04Minus14,
        #[serde(rename = "gpt-4.1-mini-2025-04-14")]
        Gpt41Mini2025Minus04Minus14,
        #[serde(rename = "gpt-4.1-nano-2025-04-14")]
        Gpt41Nano2025Minus04Minus14,
        #[serde(rename = "o4-mini")]
        O4Mini,
        #[serde(rename = "o4-mini-2025-04-16")]
        O4Mini2025Minus04Minus16,
        #[serde(rename = "o3")]
        O3,
        #[serde(rename = "o3-2025-04-16")]
        O3Minus2025Minus04Minus16,
        #[serde(rename = "o3-mini")]
        O3Mini,
        #[serde(rename = "o3-mini-2025-01-31")]
        O3Mini2025Minus01Minus31,
        #[serde(rename = "o1")]
        O1,
        #[serde(rename = "o1-2024-12-17")]
        O1Minus2024Minus12Minus17,
        #[serde(rename = "o1-preview")]
        O1Preview,
        #[serde(rename = "o1-preview-2024-09-12")]
        O1Preview2024Minus09Minus12,
        #[serde(rename = "o1-mini")]
        O1Mini,
        #[serde(rename = "o1-mini-2024-09-12")]
        O1Mini2024Minus09Minus12,
        #[serde(rename = "gpt-4o")]
        Gpt4o,
        #[serde(rename = "gpt-4o-2024-11-20")]
        Gpt4o2024Minus11Minus20,
        #[serde(rename = "gpt-4o-2024-08-06")]
        Gpt4o2024Minus08Minus06,
        #[serde(rename = "gpt-4o-2024-05-13")]
        Gpt4o2024Minus05Minus13,
        #[serde(rename = "gpt-4o-audio-preview")]
        Gpt4oAudioPreview,
        #[serde(rename = "gpt-4o-audio-preview-2024-10-01")]
        Gpt4oAudioPreview2024Minus10Minus01,
        #[serde(rename = "gpt-4o-audio-preview-2024-12-17")]
        Gpt4oAudioPreview2024Minus12Minus17,
        #[serde(rename = "gpt-4o-audio-preview-2025-06-03")]
        Gpt4oAudioPreview2025Minus06Minus03,
        #[serde(rename = "gpt-4o-mini-audio-preview")]
        Gpt4oMiniAudioPreview,
        #[serde(rename = "gpt-4o-mini-audio-preview-2024-12-17")]
        Gpt4oMiniAudioPreview2024Minus12Minus17,
        #[serde(rename = "gpt-4o-search-preview")]
        Gpt4oSearchPreview,
        #[serde(rename = "gpt-4o-mini-search-preview")]
        Gpt4oMiniSearchPreview,
        #[serde(rename = "gpt-4o-search-preview-2025-03-11")]
        Gpt4oSearchPreview2025Minus03Minus11,
        #[serde(rename = "gpt-4o-mini-search-preview-2025-03-11")]
        Gpt4oMiniSearchPreview2025Minus03Minus11,
        #[serde(rename = "chatgpt-4o-latest")]
        Chatgpt4oLatest,
        #[serde(rename = "codex-mini-latest")]
        CodexMiniLatest,
        #[serde(rename = "gpt-4o-mini")]
        Gpt4oMini,
        #[serde(rename = "gpt-4o-mini-2024-07-18")]
        Gpt4oMini2024Minus07Minus18,
        #[serde(rename = "gpt-4-turbo")]
        Gpt4Turbo,
        #[serde(rename = "gpt-4-turbo-2024-04-09")]
        Gpt4Turbo2024Minus04Minus09,
        #[serde(rename = "gpt-4-0125-preview")]
        Gpt4Minus0125Preview,
        #[serde(rename = "gpt-4-turbo-preview")]
        Gpt4TurboPreview,
        #[serde(rename = "gpt-4-1106-preview")]
        Gpt4Minus1106Preview,
        #[serde(rename = "gpt-4-vision-preview")]
        Gpt4VisionPreview,
        #[serde(rename = "gpt-4")]
        Gpt4,
        #[serde(rename = "gpt-4-0314")]
        Gpt4Minus0314,
        #[serde(rename = "gpt-4-0613")]
        Gpt4Minus0613,
        #[serde(rename = "gpt-4-32k")]
        Gpt4Minus32k,
        #[serde(rename = "gpt-4-32k-0314")]
        Gpt4Minus32k0314,
        #[serde(rename = "gpt-4-32k-0613")]
        Gpt4Minus32k0613,
        #[serde(rename = "gpt-3.5-turbo")]
        Gpt35Turbo,
        #[serde(rename = "gpt-3.5-turbo-16k")]
        Gpt35Turbo16k,
        #[serde(rename = "gpt-3.5-turbo-0301")]
        Gpt35Turbo0301,
        #[serde(rename = "gpt-3.5-turbo-0613")]
        Gpt35Turbo0613,
        #[serde(rename = "gpt-3.5-turbo-1106")]
        Gpt35Turbo1106,
        #[serde(rename = "gpt-3.5-turbo-0125")]
        Gpt35Turbo0125,
        #[serde(rename = "gpt-3.5-turbo-16k-0613")]
        Gpt35Turbo16k0613,
    }
    impl ::std::fmt::Display for ModelIdsSharedVariant1 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Gpt54 => ::std::write!(__f, "gpt-5.4"),
                Self::Gpt54Mini => ::std::write!(__f, "gpt-5.4-mini"),
                Self::Gpt54Nano => ::std::write!(__f, "gpt-5.4-nano"),
                Self::Gpt54Mini2026Minus03Minus17 => {
                    ::std::write!(__f, "gpt-5.4-mini-2026-03-17")
                }
                Self::Gpt54Nano2026Minus03Minus17 => {
                    ::std::write!(__f, "gpt-5.4-nano-2026-03-17")
                }
                Self::Gpt53ChatLatest => ::std::write!(__f, "gpt-5.3-chat-latest"),
                Self::Gpt52 => ::std::write!(__f, "gpt-5.2"),
                Self::Gpt52Minus2025Minus12Minus11 => {
                    ::std::write!(__f, "gpt-5.2-2025-12-11")
                }
                Self::Gpt52ChatLatest => ::std::write!(__f, "gpt-5.2-chat-latest"),
                Self::Gpt52Pro => ::std::write!(__f, "gpt-5.2-pro"),
                Self::Gpt52Pro2025Minus12Minus11 => {
                    ::std::write!(__f, "gpt-5.2-pro-2025-12-11")
                }
                Self::Gpt51 => ::std::write!(__f, "gpt-5.1"),
                Self::Gpt51Minus2025Minus11Minus13 => {
                    ::std::write!(__f, "gpt-5.1-2025-11-13")
                }
                Self::Gpt51Codex => ::std::write!(__f, "gpt-5.1-codex"),
                Self::Gpt51Mini => ::std::write!(__f, "gpt-5.1-mini"),
                Self::Gpt51ChatLatest => ::std::write!(__f, "gpt-5.1-chat-latest"),
                Self::Gpt5 => ::std::write!(__f, "gpt-5"),
                Self::Gpt5Mini => ::std::write!(__f, "gpt-5-mini"),
                Self::Gpt5Nano => ::std::write!(__f, "gpt-5-nano"),
                Self::Gpt5Minus2025Minus08Minus07 => {
                    ::std::write!(__f, "gpt-5-2025-08-07")
                }
                Self::Gpt5Mini2025Minus08Minus07 => {
                    ::std::write!(__f, "gpt-5-mini-2025-08-07")
                }
                Self::Gpt5Nano2025Minus08Minus07 => {
                    ::std::write!(__f, "gpt-5-nano-2025-08-07")
                }
                Self::Gpt5ChatLatest => ::std::write!(__f, "gpt-5-chat-latest"),
                Self::Gpt41 => ::std::write!(__f, "gpt-4.1"),
                Self::Gpt41Mini => ::std::write!(__f, "gpt-4.1-mini"),
                Self::Gpt41Nano => ::std::write!(__f, "gpt-4.1-nano"),
                Self::Gpt41Minus2025Minus04Minus14 => {
                    ::std::write!(__f, "gpt-4.1-2025-04-14")
                }
                Self::Gpt41Mini2025Minus04Minus14 => {
                    ::std::write!(__f, "gpt-4.1-mini-2025-04-14")
                }
                Self::Gpt41Nano2025Minus04Minus14 => {
                    ::std::write!(__f, "gpt-4.1-nano-2025-04-14")
                }
                Self::O4Mini => ::std::write!(__f, "o4-mini"),
                Self::O4Mini2025Minus04Minus16 => {
                    ::std::write!(__f, "o4-mini-2025-04-16")
                }
                Self::O3 => ::std::write!(__f, "o3"),
                Self::O3Minus2025Minus04Minus16 => ::std::write!(__f, "o3-2025-04-16"),
                Self::O3Mini => ::std::write!(__f, "o3-mini"),
                Self::O3Mini2025Minus01Minus31 => {
                    ::std::write!(__f, "o3-mini-2025-01-31")
                }
                Self::O1 => ::std::write!(__f, "o1"),
                Self::O1Minus2024Minus12Minus17 => ::std::write!(__f, "o1-2024-12-17"),
                Self::O1Preview => ::std::write!(__f, "o1-preview"),
                Self::O1Preview2024Minus09Minus12 => {
                    ::std::write!(__f, "o1-preview-2024-09-12")
                }
                Self::O1Mini => ::std::write!(__f, "o1-mini"),
                Self::O1Mini2024Minus09Minus12 => {
                    ::std::write!(__f, "o1-mini-2024-09-12")
                }
                Self::Gpt4o => ::std::write!(__f, "gpt-4o"),
                Self::Gpt4o2024Minus11Minus20 => ::std::write!(__f, "gpt-4o-2024-11-20"),
                Self::Gpt4o2024Minus08Minus06 => ::std::write!(__f, "gpt-4o-2024-08-06"),
                Self::Gpt4o2024Minus05Minus13 => ::std::write!(__f, "gpt-4o-2024-05-13"),
                Self::Gpt4oAudioPreview => ::std::write!(__f, "gpt-4o-audio-preview"),
                Self::Gpt4oAudioPreview2024Minus10Minus01 => {
                    ::std::write!(__f, "gpt-4o-audio-preview-2024-10-01")
                }
                Self::Gpt4oAudioPreview2024Minus12Minus17 => {
                    ::std::write!(__f, "gpt-4o-audio-preview-2024-12-17")
                }
                Self::Gpt4oAudioPreview2025Minus06Minus03 => {
                    ::std::write!(__f, "gpt-4o-audio-preview-2025-06-03")
                }
                Self::Gpt4oMiniAudioPreview => {
                    ::std::write!(__f, "gpt-4o-mini-audio-preview")
                }
                Self::Gpt4oMiniAudioPreview2024Minus12Minus17 => {
                    ::std::write!(__f, "gpt-4o-mini-audio-preview-2024-12-17")
                }
                Self::Gpt4oSearchPreview => ::std::write!(__f, "gpt-4o-search-preview"),
                Self::Gpt4oMiniSearchPreview => {
                    ::std::write!(__f, "gpt-4o-mini-search-preview")
                }
                Self::Gpt4oSearchPreview2025Minus03Minus11 => {
                    ::std::write!(__f, "gpt-4o-search-preview-2025-03-11")
                }
                Self::Gpt4oMiniSearchPreview2025Minus03Minus11 => {
                    ::std::write!(__f, "gpt-4o-mini-search-preview-2025-03-11")
                }
                Self::Chatgpt4oLatest => ::std::write!(__f, "chatgpt-4o-latest"),
                Self::CodexMiniLatest => ::std::write!(__f, "codex-mini-latest"),
                Self::Gpt4oMini => ::std::write!(__f, "gpt-4o-mini"),
                Self::Gpt4oMini2024Minus07Minus18 => {
                    ::std::write!(__f, "gpt-4o-mini-2024-07-18")
                }
                Self::Gpt4Turbo => ::std::write!(__f, "gpt-4-turbo"),
                Self::Gpt4Turbo2024Minus04Minus09 => {
                    ::std::write!(__f, "gpt-4-turbo-2024-04-09")
                }
                Self::Gpt4Minus0125Preview => ::std::write!(__f, "gpt-4-0125-preview"),
                Self::Gpt4TurboPreview => ::std::write!(__f, "gpt-4-turbo-preview"),
                Self::Gpt4Minus1106Preview => ::std::write!(__f, "gpt-4-1106-preview"),
                Self::Gpt4VisionPreview => ::std::write!(__f, "gpt-4-vision-preview"),
                Self::Gpt4 => ::std::write!(__f, "gpt-4"),
                Self::Gpt4Minus0314 => ::std::write!(__f, "gpt-4-0314"),
                Self::Gpt4Minus0613 => ::std::write!(__f, "gpt-4-0613"),
                Self::Gpt4Minus32k => ::std::write!(__f, "gpt-4-32k"),
                Self::Gpt4Minus32k0314 => ::std::write!(__f, "gpt-4-32k-0314"),
                Self::Gpt4Minus32k0613 => ::std::write!(__f, "gpt-4-32k-0613"),
                Self::Gpt35Turbo => ::std::write!(__f, "gpt-3.5-turbo"),
                Self::Gpt35Turbo16k => ::std::write!(__f, "gpt-3.5-turbo-16k"),
                Self::Gpt35Turbo0301 => ::std::write!(__f, "gpt-3.5-turbo-0301"),
                Self::Gpt35Turbo0613 => ::std::write!(__f, "gpt-3.5-turbo-0613"),
                Self::Gpt35Turbo1106 => ::std::write!(__f, "gpt-3.5-turbo-1106"),
                Self::Gpt35Turbo0125 => ::std::write!(__f, "gpt-3.5-turbo-0125"),
                Self::Gpt35Turbo16k0613 => ::std::write!(__f, "gpt-3.5-turbo-16k-0613"),
            }
        }
    }
    impl ::std::convert::From<String> for ModelIdsShared {
        fn from(value: String) -> Self {
            ModelIdsShared::ModelIdsSharedVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ModelIdsShared> for String {
        type Error = ModelIdsShared;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ModelIdsShared) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelIdsShared::ModelIdsSharedVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ModelIdsSharedVariant1> for ModelIdsShared {
        fn from(value: ModelIdsSharedVariant1) -> Self {
            ModelIdsShared::ModelIdsSharedVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ModelIdsShared> for ModelIdsSharedVariant1 {
        type Error = ModelIdsShared;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ModelIdsShared) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelIdsShared::ModelIdsSharedVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ModelIdsShared {
        ModelIdsSharedVariant0(String),
        ModelIdsSharedVariant1(ModelIdsSharedVariant1),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ModelResponsePropertiesTopLogprobs {
        ModelResponsePropertiesTopLogprobsVariant0(i64),
        ModelResponsePropertiesTopLogprobsVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<i64> for ModelResponsePropertiesTopLogprobs {
        fn from(value: i64) -> Self {
            ModelResponsePropertiesTopLogprobs::ModelResponsePropertiesTopLogprobsVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTopLogprobs> for i64 {
        type Error = ModelResponsePropertiesTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTopLogprobs::ModelResponsePropertiesTopLogprobsVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ModelResponsePropertiesTopLogprobs {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ModelResponsePropertiesTopLogprobs::ModelResponsePropertiesTopLogprobsVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTopLogprobs> for Option<::serde_json::Value> {
        type Error = ModelResponsePropertiesTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTopLogprobs::ModelResponsePropertiesTopLogprobsVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ModelResponsePropertiesTemperature {
        ModelResponsePropertiesTemperatureVariant0(f64),
        ModelResponsePropertiesTemperatureVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for ModelResponsePropertiesTemperature {
        fn from(value: f64) -> Self {
            ModelResponsePropertiesTemperature::ModelResponsePropertiesTemperatureVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTemperature> for f64 {
        type Error = ModelResponsePropertiesTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTemperature::ModelResponsePropertiesTemperatureVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ModelResponsePropertiesTemperature {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ModelResponsePropertiesTemperature::ModelResponsePropertiesTemperatureVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTemperature> for Option<::serde_json::Value> {
        type Error = ModelResponsePropertiesTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTemperature::ModelResponsePropertiesTemperatureVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ModelResponsePropertiesTopP {
        ModelResponsePropertiesTopPVariant0(f64),
        ModelResponsePropertiesTopPVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for ModelResponsePropertiesTopP {
        fn from(value: f64) -> Self {
            ModelResponsePropertiesTopP::ModelResponsePropertiesTopPVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTopP> for f64 {
        type Error = ModelResponsePropertiesTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTopP::ModelResponsePropertiesTopPVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ModelResponsePropertiesTopP {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ModelResponsePropertiesTopP::ModelResponsePropertiesTopPVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesTopP> for Option<::serde_json::Value> {
        type Error = ModelResponsePropertiesTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesTopP::ModelResponsePropertiesTopPVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention).
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ModelResponsePropertiesPromptCacheRetentionVariant0 {
        #[serde(rename = "in_memory")]
        InMemory,
        #[serde(rename = "24h")]
        _24h,
    }
    impl ::std::fmt::Display for ModelResponsePropertiesPromptCacheRetentionVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::InMemory => ::std::write!(__f, "in_memory"),
                Self::_24h => ::std::write!(__f, "24h"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ModelResponsePropertiesPromptCacheRetention {
        ModelResponsePropertiesPromptCacheRetentionVariant0(
            ModelResponsePropertiesPromptCacheRetentionVariant0,
        ),
        ModelResponsePropertiesPromptCacheRetentionVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<ModelResponsePropertiesPromptCacheRetentionVariant0>
        for ModelResponsePropertiesPromptCacheRetention
    {
        fn from(value: ModelResponsePropertiesPromptCacheRetentionVariant0) -> Self {
            ModelResponsePropertiesPromptCacheRetention::ModelResponsePropertiesPromptCacheRetentionVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesPromptCacheRetention>
        for ModelResponsePropertiesPromptCacheRetentionVariant0
    {
        type Error = ModelResponsePropertiesPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesPromptCacheRetention::ModelResponsePropertiesPromptCacheRetentionVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ModelResponsePropertiesPromptCacheRetention
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ModelResponsePropertiesPromptCacheRetention::ModelResponsePropertiesPromptCacheRetentionVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ModelResponsePropertiesPromptCacheRetention>
        for Option<::serde_json::Value>
    {
        type Error = ModelResponsePropertiesPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ModelResponsePropertiesPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ModelResponsePropertiesPromptCacheRetention::ModelResponsePropertiesPromptCacheRetentionVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ModelResponseProperties {
        #[serde(skip_serializing_if = "Option::is_none")]
        pub metadata: Option<Metadata>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_logprobs: Option<ModelResponsePropertiesTopLogprobs>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub temperature: Option<ModelResponsePropertiesTemperature>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_p: Option<ModelResponsePropertiesTopP>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.
        /// A stable identifier for your end-users.
        /// Used to boost cache hit rates by better bucketing similar requests and  to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        #[deprecated]
        pub user: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
        /// The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        pub safety_identifier: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
        pub prompt_cache_key: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub service_tier: Option<ServiceTier>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub prompt_cache_retention: Option<ModelResponsePropertiesPromptCacheRetention>,
    }
    /// Constrains the verbosity of the model's response. Lower values will result in
    /// more concise responses, while higher values will result in more verbose responses.
    /// Currently supported values are `low`, `medium`, and `high`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum VerbosityVariant0 {
        #[serde(rename = "low")]
        Low,
        #[serde(rename = "medium")]
        Medium,
        #[serde(rename = "high")]
        High,
    }
    impl ::std::fmt::Display for VerbosityVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Low => ::std::write!(__f, "low"),
                Self::Medium => ::std::write!(__f, "medium"),
                Self::High => ::std::write!(__f, "high"),
            }
        }
    }
    impl ::std::convert::From<VerbosityVariant0> for Verbosity {
        fn from(value: VerbosityVariant0) -> Self {
            Verbosity::VerbosityVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<Verbosity> for VerbosityVariant0 {
        type Error = Verbosity;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: Verbosity) -> ::std::result::Result<Self, Self::Error> {
            match value {
                Verbosity::VerbosityVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for Verbosity {
        fn from(value: Option<::serde_json::Value>) -> Self {
            Verbosity::VerbosityVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<Verbosity> for Option<::serde_json::Value> {
        type Error = Verbosity;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: Verbosity) -> ::std::result::Result<Self, Self::Error> {
            match value {
                Verbosity::VerbosityVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum Verbosity {
        VerbosityVariant0(VerbosityVariant0),
        VerbosityVariant1(Option<::serde_json::Value>),
    }
    /// The type of the predicted content you want to provide. This type is
    /// currently always `content`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum PredictionContentType {
        #[serde(rename = "content")]
        Content,
    }
    impl ::std::fmt::Display for PredictionContentType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Content => ::std::write!(__f, "content"),
            }
        }
    }
    /// The type of the content part.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartTextType {
        #[serde(rename = "text")]
        Text,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartTextType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Text => ::std::write!(__f, "text"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Text content part
    /// Learn about [text inputs](/docs/guides/text-generation).
    pub struct ChatCompletionRequestMessageContentPartText {
        /// The type of the content part.
        pub r#type: ChatCompletionRequestMessageContentPartTextType,
        /// The text content.
        pub text: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The content that should be matched when generating a model response.
    /// If generated tokens would match this content, the entire model response
    /// can be returned much more quickly.
    pub enum PredictionContentContent {
        PredictionContentContentVariant0(String),
        PredictionContentContentVariant1(Vec<ChatCompletionRequestMessageContentPartText>),
    }
    impl ::std::convert::From<String> for PredictionContentContent {
        fn from(value: String) -> Self {
            PredictionContentContent::PredictionContentContentVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<PredictionContentContent> for String {
        type Error = PredictionContentContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: PredictionContentContent) -> ::std::result::Result<Self, Self::Error> {
            match value {
                PredictionContentContent::PredictionContentContentVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestMessageContentPartText>>
        for PredictionContentContent
    {
        fn from(value: Vec<ChatCompletionRequestMessageContentPartText>) -> Self {
            PredictionContentContent::PredictionContentContentVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<PredictionContentContent>
        for Vec<ChatCompletionRequestMessageContentPartText>
    {
        type Error = PredictionContentContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: PredictionContentContent) -> ::std::result::Result<Self, Self::Error> {
            match value {
                PredictionContentContent::PredictionContentContentVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Static Content
    /// Static predicted output content, such as the content of a text file that is
    /// being regenerated.
    pub struct PredictionContent {
        /// The type of the predicted content you want to provide. This type is
        /// currently always `content`.
        pub r#type: PredictionContentType,
        /// The content that should be matched when generating a model response.
        /// If generated tokens would match this content, the entire model response
        /// can be returned much more quickly.
        pub content: PredictionContentContent,
    }
    /// Constrains effort on reasoning for
    /// [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    /// Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing
    /// reasoning effort can result in faster responses and fewer tokens used
    /// on reasoning in a response.
    ///
    /// - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
    /// - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
    /// - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
    /// - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ReasoningEffortVariant0 {
        #[serde(rename = "none")]
        None,
        #[serde(rename = "minimal")]
        Minimal,
        #[serde(rename = "low")]
        Low,
        #[serde(rename = "medium")]
        Medium,
        #[serde(rename = "high")]
        High,
        #[serde(rename = "xhigh")]
        Xhigh,
    }
    impl ::std::fmt::Display for ReasoningEffortVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::None => ::std::write!(__f, "none"),
                Self::Minimal => ::std::write!(__f, "minimal"),
                Self::Low => ::std::write!(__f, "low"),
                Self::Medium => ::std::write!(__f, "medium"),
                Self::High => ::std::write!(__f, "high"),
                Self::Xhigh => ::std::write!(__f, "xhigh"),
            }
        }
    }
    impl ::std::convert::From<ReasoningEffortVariant0> for ReasoningEffort {
        fn from(value: ReasoningEffortVariant0) -> Self {
            ReasoningEffort::ReasoningEffortVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ReasoningEffort> for ReasoningEffortVariant0 {
        type Error = ReasoningEffort;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ReasoningEffort) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ReasoningEffort::ReasoningEffortVariant0(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ReasoningEffort {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ReasoningEffort::ReasoningEffortVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ReasoningEffort> for Option<::serde_json::Value> {
        type Error = ReasoningEffort;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ReasoningEffort) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ReasoningEffort::ReasoningEffortVariant1(inner) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ReasoningEffort {
        ReasoningEffortVariant0(ReasoningEffortVariant0),
        ReasoningEffortVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for StopConfiguration {
        fn from(value: String) -> Self {
            StopConfiguration::StopConfigurationVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<StopConfiguration> for String {
        type Error = StopConfiguration;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: StopConfiguration) -> ::std::result::Result<Self, Self::Error> {
            match value {
                StopConfiguration::StopConfigurationVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<String>> for StopConfiguration {
        fn from(value: Vec<String>) -> Self {
            StopConfiguration::StopConfigurationVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<StopConfiguration> for Vec<String> {
        type Error = StopConfiguration;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: StopConfiguration) -> ::std::result::Result<Self, Self::Error> {
            match value {
                StopConfiguration::StopConfigurationVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// Not supported with latest reasoning models `o3` and `o4-mini`.
    ///
    /// Up to 4 sequences where the API will stop generating further tokens. The
    /// returned text will not contain the stop sequence.
    pub enum StopConfiguration {
        StopConfigurationVariant0(String),
        StopConfigurationVariant1(Vec<String>),
    }
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ResponseModalitiesVariant0 {
        #[serde(rename = "text")]
        Text,
        #[serde(rename = "audio")]
        Audio,
    }
    impl ::std::fmt::Display for ResponseModalitiesVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Text => ::std::write!(__f, "text"),
                Self::Audio => ::std::write!(__f, "audio"),
            }
        }
    }
    impl ::std::convert::From<Vec<ResponseModalitiesVariant0>> for ResponseModalities {
        fn from(value: Vec<ResponseModalitiesVariant0>) -> Self {
            ResponseModalities::ResponseModalitiesVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ResponseModalities> for Vec<ResponseModalitiesVariant0> {
        type Error = ResponseModalities;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ResponseModalities) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ResponseModalities::ResponseModalitiesVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ResponseModalities {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ResponseModalities::ResponseModalitiesVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ResponseModalities> for Option<::serde_json::Value> {
        type Error = ResponseModalities;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(value: ResponseModalities) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ResponseModalities::ResponseModalitiesVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ResponseModalities {
        ResponseModalitiesVariant0(Vec<ResponseModalitiesVariant0>),
        ResponseModalitiesVariant1(Option<::serde_json::Value>),
    }
    /// The type of response format being defined. Always `text`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ResponseFormatTextType {
        #[serde(rename = "text")]
        Text,
    }
    impl ::std::fmt::Display for ResponseFormatTextType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Text => ::std::write!(__f, "text"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Text
    /// Default response format. Used to generate text responses.
    pub struct ResponseFormatText {
        /// The type of response format being defined. Always `text`.
        pub r#type: ResponseFormatTextType,
    }
    /// # JSON schema
    /// The schema for the response format, described as a JSON Schema object.
    /// Learn how to build JSON schemas [here](https://json-schema.org/).
    pub type ResponseFormatJsonSchemaSchema =
        ::std::collections::BTreeMap<String, ::serde_json::Value>;
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Web search location
    /// Approximate location parameters for the search.
    pub struct WebSearchLocation {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The two-letter
        /// [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,
        /// e.g. `US`.
        pub country: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Free text input for the region of the user, e.g. `California`.
        pub region: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Free text input for the city of the user, e.g. `San Francisco`.
        pub city: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The [IANA timezone](https://timeapi.io/documentation/iana-timezones)
        /// of the user, e.g. `America/Los_Angeles`.
        pub timezone: Option<String>,
    }
    impl ::std::fmt::Display for WebSearchContextSize {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Low => ::std::write!(__f, "low"),
                Self::Medium => ::std::write!(__f, "medium"),
                Self::High => ::std::write!(__f, "high"),
            }
        }
    }
    /// High level guidance for the amount of context window space to use for the
    /// search. One of `low`, `medium`, or `high`. `medium` is the default.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum WebSearchContextSize {
        #[serde(rename = "low")]
        Low,
        #[serde(rename = "medium")]
        Medium,
        #[serde(rename = "high")]
        High,
    }
    /// The object type, which is always "model".
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ModelObject {
        #[serde(rename = "model")]
        Model,
    }
    impl ::std::fmt::Display for ModelObject {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Model => ::std::write!(__f, "model"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Model
    /// Describes an OpenAI model offering that can be used with the API.
    pub struct Model {
        /// The model identifier, which can be referenced in the API endpoints.
        pub id: String,
        /// The Unix timestamp (in seconds) when the model was created.
        pub created: i64,
        /// The object type, which is always "model".
        pub object: ModelObject,
        /// The organization that owns the model.
        pub owned_by: String,
    }
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ListModelsResponseObject {
        #[serde(rename = "list")]
        List,
    }
    impl ::std::fmt::Display for ListModelsResponseObject {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::List => ::std::write!(__f, "list"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ListModelsResponse {
        pub object: ListModelsResponseObject,
        pub data: Vec<Model>,
    }
    /// The type of response format being defined. Always `json_schema`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ResponseFormatJsonSchemaType {
        #[serde(rename = "json_schema")]
        JsonSchema,
    }
    impl ::std::fmt::Display for ResponseFormatJsonSchemaType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::JsonSchema => ::std::write!(__f, "json_schema"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ResponseFormatJsonSchemaJsonSchemaStrict {
        ResponseFormatJsonSchemaJsonSchemaStrictVariant0(bool),
        ResponseFormatJsonSchemaJsonSchemaStrictVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<bool> for ResponseFormatJsonSchemaJsonSchemaStrict {
        fn from(value: bool) -> Self {
            ResponseFormatJsonSchemaJsonSchemaStrict::ResponseFormatJsonSchemaJsonSchemaStrictVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ResponseFormatJsonSchemaJsonSchemaStrict> for bool {
        type Error = ResponseFormatJsonSchemaJsonSchemaStrict;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ResponseFormatJsonSchemaJsonSchemaStrict,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ResponseFormatJsonSchemaJsonSchemaStrict::ResponseFormatJsonSchemaJsonSchemaStrictVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ResponseFormatJsonSchemaJsonSchemaStrict
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ResponseFormatJsonSchemaJsonSchemaStrict::ResponseFormatJsonSchemaJsonSchemaStrictVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ResponseFormatJsonSchemaJsonSchemaStrict>
        for Option<::serde_json::Value>
    {
        type Error = ResponseFormatJsonSchemaJsonSchemaStrict;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ResponseFormatJsonSchemaJsonSchemaStrict,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ResponseFormatJsonSchemaJsonSchemaStrict::ResponseFormatJsonSchemaJsonSchemaStrictVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # JSON schema
    /// Structured Outputs configuration options, including a JSON Schema.
    pub struct ResponseFormatJsonSchemaJsonSchema {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A description of what the response format is for, used by the model to
        /// determine how to respond in the format.
        pub description: Option<String>,
        /// 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.
        pub name: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub schema: Option<ResponseFormatJsonSchemaSchema>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub strict: Option<ResponseFormatJsonSchemaJsonSchemaStrict>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # JSON schema
    /// JSON Schema response format. Used to generate structured JSON responses.
    /// Learn more about [Structured Outputs](/docs/guides/structured-outputs).
    pub struct ResponseFormatJsonSchema {
        /// The type of response format being defined. Always `json_schema`.
        pub r#type: ResponseFormatJsonSchemaType,
        /// Structured Outputs configuration options, including a JSON Schema.
        pub json_schema: ResponseFormatJsonSchemaJsonSchema,
    }
    /// The type of response format being defined. Always `json_object`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ResponseFormatJsonObjectType {
        #[serde(rename = "json_object")]
        JsonObject,
    }
    impl ::std::fmt::Display for ResponseFormatJsonObjectType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::JsonObject => ::std::write!(__f, "json_object"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # JSON object
    /// 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.
    pub struct ResponseFormatJsonObject {
        /// The type of response format being defined. Always `json_object`.
        pub r#type: ResponseFormatJsonObjectType,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
    pub struct ChatCompletionFunctionCallOption {
        /// The name of the function to call.
        pub name: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[deprecated]
    pub struct ChatCompletionFunctions {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A description of what the function does, used by the model to choose when and how to call the function.
        pub description: Option<String>,
        /// 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.
        pub name: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub parameters: Option<FunctionParameters>,
    }
    /// Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
    pub type ParallelToolCalls = bool;
    /// The type of the tool. Always `custom`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionMessageCustomToolCallType {
        #[serde(rename = "custom")]
        Custom,
    }
    impl ::std::fmt::Display for ChatCompletionMessageCustomToolCallType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Custom => ::std::write!(__f, "custom"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// The custom tool that the model called.
    pub struct ChatCompletionMessageCustomToolCallCustom {
        /// The name of the custom tool to call.
        pub name: String,
        /// The input for the custom tool call generated by the model.
        pub input: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Custom tool call
    /// A call to a custom tool created by the model.
    pub struct ChatCompletionMessageCustomToolCall {
        /// The ID of the tool call.
        pub id: String,
        /// The type of the tool. Always `custom`.
        pub r#type: ChatCompletionMessageCustomToolCallType,
        /// The custom tool that the model called.
        pub custom: ChatCompletionMessageCustomToolCallCustom,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionRequestTopLogprobs {
        CreateChatCompletionRequestTopLogprobsVariant0(i64),
        CreateChatCompletionRequestTopLogprobsVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<i64> for CreateChatCompletionRequestTopLogprobs {
        fn from(value: i64) -> Self {
            CreateChatCompletionRequestTopLogprobs::CreateChatCompletionRequestTopLogprobsVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTopLogprobs> for i64 {
        type Error = CreateChatCompletionRequestTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTopLogprobs::CreateChatCompletionRequestTopLogprobsVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for CreateChatCompletionRequestTopLogprobs {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionRequestTopLogprobs::CreateChatCompletionRequestTopLogprobsVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTopLogprobs>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionRequestTopLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTopLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTopLogprobs::CreateChatCompletionRequestTopLogprobsVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionRequestTemperature {
        CreateChatCompletionRequestTemperatureVariant0(f64),
        CreateChatCompletionRequestTemperatureVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for CreateChatCompletionRequestTemperature {
        fn from(value: f64) -> Self {
            CreateChatCompletionRequestTemperature::CreateChatCompletionRequestTemperatureVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTemperature> for f64 {
        type Error = CreateChatCompletionRequestTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTemperature::CreateChatCompletionRequestTemperatureVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for CreateChatCompletionRequestTemperature {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionRequestTemperature::CreateChatCompletionRequestTemperatureVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTemperature>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionRequestTemperature;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTemperature,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTemperature::CreateChatCompletionRequestTemperatureVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionRequestTopP {
        CreateChatCompletionRequestTopPVariant0(f64),
        CreateChatCompletionRequestTopPVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<f64> for CreateChatCompletionRequestTopP {
        fn from(value: f64) -> Self {
            CreateChatCompletionRequestTopP::CreateChatCompletionRequestTopPVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTopP> for f64 {
        type Error = CreateChatCompletionRequestTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTopP::CreateChatCompletionRequestTopPVariant0(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for CreateChatCompletionRequestTopP {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionRequestTopP::CreateChatCompletionRequestTopPVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTopP> for Option<::serde_json::Value> {
        type Error = CreateChatCompletionRequestTopP;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTopP,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTopP::CreateChatCompletionRequestTopPVariant1(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention).
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionRequestPromptCacheRetentionVariant0 {
        #[serde(rename = "in_memory")]
        InMemory,
        #[serde(rename = "24h")]
        _24h,
    }
    impl ::std::fmt::Display for CreateChatCompletionRequestPromptCacheRetentionVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::InMemory => ::std::write!(__f, "in_memory"),
                Self::_24h => ::std::write!(__f, "24h"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionRequestPromptCacheRetention {
        CreateChatCompletionRequestPromptCacheRetentionVariant0(
            CreateChatCompletionRequestPromptCacheRetentionVariant0,
        ),
        CreateChatCompletionRequestPromptCacheRetentionVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<CreateChatCompletionRequestPromptCacheRetentionVariant0>
        for CreateChatCompletionRequestPromptCacheRetention
    {
        fn from(value: CreateChatCompletionRequestPromptCacheRetentionVariant0) -> Self {
            CreateChatCompletionRequestPromptCacheRetention::CreateChatCompletionRequestPromptCacheRetentionVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestPromptCacheRetention>
        for CreateChatCompletionRequestPromptCacheRetentionVariant0
    {
        type Error = CreateChatCompletionRequestPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestPromptCacheRetention::CreateChatCompletionRequestPromptCacheRetentionVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateChatCompletionRequestPromptCacheRetention
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionRequestPromptCacheRetention::CreateChatCompletionRequestPromptCacheRetentionVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestPromptCacheRetention>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionRequestPromptCacheRetention;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestPromptCacheRetention,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestPromptCacheRetention::CreateChatCompletionRequestPromptCacheRetentionVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The contents of the developer message.
    pub enum ChatCompletionRequestDeveloperMessageContent {
        ChatCompletionRequestDeveloperMessageContentVariant0(String),
        ChatCompletionRequestDeveloperMessageContentVariant1(
            Vec<ChatCompletionRequestMessageContentPartText>,
        ),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestDeveloperMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionRequestDeveloperMessageContent::ChatCompletionRequestDeveloperMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestDeveloperMessageContent> for String {
        type Error = ChatCompletionRequestDeveloperMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestDeveloperMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestDeveloperMessageContent::ChatCompletionRequestDeveloperMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestMessageContentPartText>>
        for ChatCompletionRequestDeveloperMessageContent
    {
        fn from(value: Vec<ChatCompletionRequestMessageContentPartText>) -> Self {
            ChatCompletionRequestDeveloperMessageContent::ChatCompletionRequestDeveloperMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestDeveloperMessageContent>
        for Vec<ChatCompletionRequestMessageContentPartText>
    {
        type Error = ChatCompletionRequestDeveloperMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestDeveloperMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestDeveloperMessageContent::ChatCompletionRequestDeveloperMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The role of the messages author, in this case `developer`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestDeveloperMessageRole {
        #[serde(rename = "developer")]
        Developer,
    }
    impl ::std::fmt::Display for ChatCompletionRequestDeveloperMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Developer => ::std::write!(__f, "developer"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Developer message
    /// Developer-provided instructions that the model should follow, regardless of
    /// messages sent by the user. With o1 models and newer, `developer` messages
    /// replace the previous `system` messages.
    pub struct ChatCompletionRequestDeveloperMessage {
        /// The contents of the developer message.
        pub content: ChatCompletionRequestDeveloperMessageContent,
        /// The role of the messages author, in this case `developer`.
        pub role: ChatCompletionRequestDeveloperMessageRole,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
        pub name: Option<String>,
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartText>
        for ChatCompletionRequestSystemMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartText) -> Self {
            ChatCompletionRequestSystemMessageContentPart::ChatCompletionRequestMessageContentPartText(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestSystemMessageContentPart>
        for ChatCompletionRequestMessageContentPartText
    {
        type Error = ChatCompletionRequestSystemMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestSystemMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestSystemMessageContentPart::ChatCompletionRequestMessageContentPartText(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestSystemMessageContentPart {
        ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The contents of the system message.
    pub enum ChatCompletionRequestSystemMessageContent {
        ChatCompletionRequestSystemMessageContentVariant0(String),
        ChatCompletionRequestSystemMessageContentVariant1(
            Vec<ChatCompletionRequestSystemMessageContentPart>,
        ),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestSystemMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionRequestSystemMessageContent::ChatCompletionRequestSystemMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestSystemMessageContent> for String {
        type Error = ChatCompletionRequestSystemMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestSystemMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestSystemMessageContent::ChatCompletionRequestSystemMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestSystemMessageContentPart>>
        for ChatCompletionRequestSystemMessageContent
    {
        fn from(value: Vec<ChatCompletionRequestSystemMessageContentPart>) -> Self {
            ChatCompletionRequestSystemMessageContent::ChatCompletionRequestSystemMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestSystemMessageContent>
        for Vec<ChatCompletionRequestSystemMessageContentPart>
    {
        type Error = ChatCompletionRequestSystemMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestSystemMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestSystemMessageContent::ChatCompletionRequestSystemMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The role of the messages author, in this case `system`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestSystemMessageRole {
        #[serde(rename = "system")]
        System,
    }
    impl ::std::fmt::Display for ChatCompletionRequestSystemMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::System => ::std::write!(__f, "system"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # System message
    /// Developer-provided instructions that the model should follow, regardless of
    /// messages sent by the user. With o1 models and newer, use `developer` messages
    /// for this purpose instead.
    pub struct ChatCompletionRequestSystemMessage {
        /// The contents of the system message.
        pub content: ChatCompletionRequestSystemMessageContent,
        /// The role of the messages author, in this case `system`.
        pub role: ChatCompletionRequestSystemMessageRole,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
        pub name: Option<String>,
    }
    /// The type of the content part.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartImageType {
        #[serde(rename = "image_url")]
        ImageUrl,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartImageType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::ImageUrl => ::std::write!(__f, "image_url"),
            }
        }
    }
    /// Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartImageImageUrlDetail {
        #[serde(rename = "auto")]
        Auto,
        #[serde(rename = "low")]
        Low,
        #[serde(rename = "high")]
        High,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartImageImageUrlDetail {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Auto => ::std::write!(__f, "auto"),
                Self::Low => ::std::write!(__f, "low"),
                Self::High => ::std::write!(__f, "high"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionRequestMessageContentPartImageImageUrl {
        /// Either a URL of the image or the base64 encoded image data.
        pub url: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).
        pub detail: Option<ChatCompletionRequestMessageContentPartImageImageUrlDetail>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Image content part
    /// Learn about [image inputs](/docs/guides/vision).
    pub struct ChatCompletionRequestMessageContentPartImage {
        /// The type of the content part.
        pub r#type: ChatCompletionRequestMessageContentPartImageType,
        pub image_url: ChatCompletionRequestMessageContentPartImageImageUrl,
    }
    /// The type of the content part. Always `input_audio`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartAudioType {
        #[serde(rename = "input_audio")]
        InputAudio,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartAudioType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::InputAudio => ::std::write!(__f, "input_audio"),
            }
        }
    }
    /// The format of the encoded audio data. Currently supports "wav" and "mp3".
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartAudioInputAudioFormat {
        #[serde(rename = "wav")]
        Wav,
        #[serde(rename = "mp3")]
        Mp3,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartAudioInputAudioFormat {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Wav => ::std::write!(__f, "wav"),
                Self::Mp3 => ::std::write!(__f, "mp3"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionRequestMessageContentPartAudioInputAudio {
        /// Base64 encoded audio data.
        pub data: String,
        /// The format of the encoded audio data. Currently supports "wav" and "mp3".
        pub format: ChatCompletionRequestMessageContentPartAudioInputAudioFormat,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Audio content part
    /// Learn about [audio inputs](/docs/guides/audio).
    pub struct ChatCompletionRequestMessageContentPartAudio {
        /// The type of the content part. Always `input_audio`.
        pub r#type: ChatCompletionRequestMessageContentPartAudioType,
        pub input_audio: ChatCompletionRequestMessageContentPartAudioInputAudio,
    }
    /// The type of the content part. Always `file`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartFileType {
        #[serde(rename = "file")]
        File,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartFileType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::File => ::std::write!(__f, "file"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct ChatCompletionRequestMessageContentPartFileFile {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The name of the file, used when passing the file to the model as a
        /// string.
        pub filename: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The base64 encoded file data, used when passing the file to the model
        /// as a string.
        pub file_data: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The ID of an uploaded file to use as input.
        pub file_id: Option<String>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # File content part
    /// Learn about [file inputs](/docs/guides/text) for text generation.
    pub struct ChatCompletionRequestMessageContentPartFile {
        /// The type of the content part. Always `file`.
        pub r#type: ChatCompletionRequestMessageContentPartFileType,
        pub file: ChatCompletionRequestMessageContentPartFileFile,
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartText>
        for ChatCompletionRequestUserMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartText) -> Self {
            ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartText(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContentPart>
        for ChatCompletionRequestMessageContentPartText
    {
        type Error = ChatCompletionRequestUserMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartText(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartImage>
        for ChatCompletionRequestUserMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartImage) -> Self {
            ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartImage(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContentPart>
        for ChatCompletionRequestMessageContentPartImage
    {
        type Error = ChatCompletionRequestUserMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartImage(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartAudio>
        for ChatCompletionRequestUserMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartAudio) -> Self {
            ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartAudio(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContentPart>
        for ChatCompletionRequestMessageContentPartAudio
    {
        type Error = ChatCompletionRequestUserMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartAudio(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartFile>
        for ChatCompletionRequestUserMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartFile) -> Self {
            ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartFile(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContentPart>
        for ChatCompletionRequestMessageContentPartFile
    {
        type Error = ChatCompletionRequestUserMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContentPart::ChatCompletionRequestMessageContentPartFile(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestUserMessageContentPart {
        ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
        ChatCompletionRequestMessageContentPartImage(ChatCompletionRequestMessageContentPartImage),
        ChatCompletionRequestMessageContentPartAudio(ChatCompletionRequestMessageContentPartAudio),
        ChatCompletionRequestMessageContentPartFile(ChatCompletionRequestMessageContentPartFile),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The contents of the user message.
    pub enum ChatCompletionRequestUserMessageContent {
        ChatCompletionRequestUserMessageContentVariant0(String),
        ChatCompletionRequestUserMessageContentVariant1(
            Vec<ChatCompletionRequestUserMessageContentPart>,
        ),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestUserMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionRequestUserMessageContent::ChatCompletionRequestUserMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContent> for String {
        type Error = ChatCompletionRequestUserMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContent::ChatCompletionRequestUserMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestUserMessageContentPart>>
        for ChatCompletionRequestUserMessageContent
    {
        fn from(value: Vec<ChatCompletionRequestUserMessageContentPart>) -> Self {
            ChatCompletionRequestUserMessageContent::ChatCompletionRequestUserMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestUserMessageContent>
        for Vec<ChatCompletionRequestUserMessageContentPart>
    {
        type Error = ChatCompletionRequestUserMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestUserMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestUserMessageContent::ChatCompletionRequestUserMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The role of the messages author, in this case `user`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestUserMessageRole {
        #[serde(rename = "user")]
        User,
    }
    impl ::std::fmt::Display for ChatCompletionRequestUserMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::User => ::std::write!(__f, "user"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # User message
    /// Messages sent by an end user, containing prompts or additional context
    /// information.
    pub struct ChatCompletionRequestUserMessage {
        /// The contents of the user message.
        pub content: ChatCompletionRequestUserMessageContent,
        /// The role of the messages author, in this case `user`.
        pub role: ChatCompletionRequestUserMessageRole,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
        pub name: Option<String>,
    }
    /// The type of the content part.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestMessageContentPartRefusalType {
        #[serde(rename = "refusal")]
        Refusal,
    }
    impl ::std::fmt::Display for ChatCompletionRequestMessageContentPartRefusalType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Refusal => ::std::write!(__f, "refusal"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Refusal content part
    pub struct ChatCompletionRequestMessageContentPartRefusal {
        /// The type of the content part.
        pub r#type: ChatCompletionRequestMessageContentPartRefusalType,
        /// The refusal message generated by the model.
        pub refusal: String,
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartText>
        for ChatCompletionRequestAssistantMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartText) -> Self {
            ChatCompletionRequestAssistantMessageContentPart::ChatCompletionRequestMessageContentPartText(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContentPart>
        for ChatCompletionRequestMessageContentPartText
    {
        type Error = ChatCompletionRequestAssistantMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContentPart::ChatCompletionRequestMessageContentPartText(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartRefusal>
        for ChatCompletionRequestAssistantMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartRefusal) -> Self {
            ChatCompletionRequestAssistantMessageContentPart::ChatCompletionRequestMessageContentPartRefusal(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContentPart>
        for ChatCompletionRequestMessageContentPartRefusal
    {
        type Error = ChatCompletionRequestAssistantMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContentPart::ChatCompletionRequestMessageContentPartRefusal(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestAssistantMessageContentPart {
        ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
        ChatCompletionRequestMessageContentPartRefusal(
            ChatCompletionRequestMessageContentPartRefusal,
        ),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
    pub enum ChatCompletionRequestAssistantMessageContentVariant0 {
        ChatCompletionRequestAssistantMessageContentVariant0Variant0(String),
        ChatCompletionRequestAssistantMessageContentVariant0Variant1(
            Vec<ChatCompletionRequestAssistantMessageContentPart>,
        ),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestAssistantMessageContentVariant0 {
        fn from(value: String) -> Self {
            ChatCompletionRequestAssistantMessageContentVariant0::ChatCompletionRequestAssistantMessageContentVariant0Variant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContentVariant0> for String {
        type Error = ChatCompletionRequestAssistantMessageContentVariant0;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContentVariant0,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContentVariant0::ChatCompletionRequestAssistantMessageContentVariant0Variant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestAssistantMessageContentPart>>
        for ChatCompletionRequestAssistantMessageContentVariant0
    {
        fn from(value: Vec<ChatCompletionRequestAssistantMessageContentPart>) -> Self {
            ChatCompletionRequestAssistantMessageContentVariant0::ChatCompletionRequestAssistantMessageContentVariant0Variant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContentVariant0>
        for Vec<ChatCompletionRequestAssistantMessageContentPart>
    {
        type Error = ChatCompletionRequestAssistantMessageContentVariant0;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContentVariant0,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContentVariant0::ChatCompletionRequestAssistantMessageContentVariant0Variant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestAssistantMessageContent {
        ChatCompletionRequestAssistantMessageContentVariant0(
            ChatCompletionRequestAssistantMessageContentVariant0,
        ),
        ChatCompletionRequestAssistantMessageContentVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<ChatCompletionRequestAssistantMessageContentVariant0>
        for ChatCompletionRequestAssistantMessageContent
    {
        fn from(value: ChatCompletionRequestAssistantMessageContentVariant0) -> Self {
            ChatCompletionRequestAssistantMessageContent::ChatCompletionRequestAssistantMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContent>
        for ChatCompletionRequestAssistantMessageContentVariant0
    {
        type Error = ChatCompletionRequestAssistantMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContent::ChatCompletionRequestAssistantMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionRequestAssistantMessageContent
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionRequestAssistantMessageContent::ChatCompletionRequestAssistantMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageContent>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionRequestAssistantMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageContent::ChatCompletionRequestAssistantMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestAssistantMessageRefusal {
        ChatCompletionRequestAssistantMessageRefusalVariant0(String),
        ChatCompletionRequestAssistantMessageRefusalVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestAssistantMessageRefusal {
        fn from(value: String) -> Self {
            ChatCompletionRequestAssistantMessageRefusal::ChatCompletionRequestAssistantMessageRefusalVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageRefusal> for String {
        type Error = ChatCompletionRequestAssistantMessageRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageRefusal::ChatCompletionRequestAssistantMessageRefusalVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionRequestAssistantMessageRefusal
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionRequestAssistantMessageRefusal::ChatCompletionRequestAssistantMessageRefusalVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageRefusal>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionRequestAssistantMessageRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageRefusal::ChatCompletionRequestAssistantMessageRefusalVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The role of the messages author, in this case `assistant`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestAssistantMessageRole {
        #[serde(rename = "assistant")]
        Assistant,
    }
    impl ::std::fmt::Display for ChatCompletionRequestAssistantMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Assistant => ::std::write!(__f, "assistant"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Data about a previous audio response from the model.
    /// [Learn more](/docs/guides/audio).
    pub struct ChatCompletionRequestAssistantMessageAudioVariant0 {
        /// Unique identifier for a previous audio response from the model.
        pub id: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestAssistantMessageAudio {
        ChatCompletionRequestAssistantMessageAudioVariant0(
            ChatCompletionRequestAssistantMessageAudioVariant0,
        ),
        ChatCompletionRequestAssistantMessageAudioVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<ChatCompletionRequestAssistantMessageAudioVariant0>
        for ChatCompletionRequestAssistantMessageAudio
    {
        fn from(value: ChatCompletionRequestAssistantMessageAudioVariant0) -> Self {
            ChatCompletionRequestAssistantMessageAudio::ChatCompletionRequestAssistantMessageAudioVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageAudio>
        for ChatCompletionRequestAssistantMessageAudioVariant0
    {
        type Error = ChatCompletionRequestAssistantMessageAudio;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageAudio,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageAudio::ChatCompletionRequestAssistantMessageAudioVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionRequestAssistantMessageAudio
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionRequestAssistantMessageAudio::ChatCompletionRequestAssistantMessageAudioVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageAudio>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionRequestAssistantMessageAudio;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageAudio,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageAudio::ChatCompletionRequestAssistantMessageAudioVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The type of the tool. Currently, only `function` is supported.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionMessageToolCallType {
        #[serde(rename = "function")]
        Function,
    }
    impl ::std::fmt::Display for ChatCompletionMessageToolCallType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Function => ::std::write!(__f, "function"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// The function that the model called.
    pub struct ChatCompletionMessageToolCallFunction {
        /// The name of the function to call.
        pub name: String,
        /// 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.
        pub arguments: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Function tool call
    /// A call to a function tool created by the model.
    pub struct ChatCompletionMessageToolCall {
        /// The ID of the tool call.
        pub id: String,
        /// The type of the tool. Currently, only `function` is supported.
        pub r#type: ChatCompletionMessageToolCallType,
        /// The function that the model called.
        pub function: ChatCompletionMessageToolCallFunction,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionMessageToolCallsItem {
        ChatCompletionMessageToolCall(ChatCompletionMessageToolCall),
        ChatCompletionMessageCustomToolCall(ChatCompletionMessageCustomToolCall),
    }
    impl ::std::convert::From<ChatCompletionMessageToolCall> for ChatCompletionMessageToolCallsItem {
        fn from(value: ChatCompletionMessageToolCall) -> Self {
            ChatCompletionMessageToolCallsItem::ChatCompletionMessageToolCall(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionMessageToolCallsItem> for ChatCompletionMessageToolCall {
        type Error = ChatCompletionMessageToolCallsItem;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionMessageToolCallsItem,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionMessageToolCallsItem::ChatCompletionMessageToolCall(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionMessageCustomToolCall>
        for ChatCompletionMessageToolCallsItem
    {
        fn from(value: ChatCompletionMessageCustomToolCall) -> Self {
            ChatCompletionMessageToolCallsItem::ChatCompletionMessageCustomToolCall(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionMessageToolCallsItem>
        for ChatCompletionMessageCustomToolCall
    {
        type Error = ChatCompletionMessageToolCallsItem;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionMessageToolCallsItem,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionMessageToolCallsItem::ChatCompletionMessageCustomToolCall(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The tool calls generated by the model, such as function calls.
    pub type ChatCompletionMessageToolCalls = Vec<ChatCompletionMessageToolCallsItem>;
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[deprecated]
    /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
    pub struct ChatCompletionRequestAssistantMessageFunctionCallVariant0 {
        /// 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.
        pub arguments: String,
        /// The name of the function to call.
        pub name: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestAssistantMessageFunctionCall {
        ChatCompletionRequestAssistantMessageFunctionCallVariant0(
            ChatCompletionRequestAssistantMessageFunctionCallVariant0,
        ),
        ChatCompletionRequestAssistantMessageFunctionCallVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<ChatCompletionRequestAssistantMessageFunctionCallVariant0>
        for ChatCompletionRequestAssistantMessageFunctionCall
    {
        fn from(value: ChatCompletionRequestAssistantMessageFunctionCallVariant0) -> Self {
            ChatCompletionRequestAssistantMessageFunctionCall::ChatCompletionRequestAssistantMessageFunctionCallVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageFunctionCall>
        for ChatCompletionRequestAssistantMessageFunctionCallVariant0
    {
        type Error = ChatCompletionRequestAssistantMessageFunctionCall;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageFunctionCall,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageFunctionCall::ChatCompletionRequestAssistantMessageFunctionCallVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionRequestAssistantMessageFunctionCall
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionRequestAssistantMessageFunctionCall::ChatCompletionRequestAssistantMessageFunctionCallVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestAssistantMessageFunctionCall>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionRequestAssistantMessageFunctionCall;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestAssistantMessageFunctionCall,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestAssistantMessageFunctionCall::ChatCompletionRequestAssistantMessageFunctionCallVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Assistant message
    /// Messages sent by the model in response to user messages.
    pub struct ChatCompletionRequestAssistantMessage {
        #[serde(skip_serializing_if = "Option::is_none")]
        pub content: Option<ChatCompletionRequestAssistantMessageContent>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub refusal: Option<ChatCompletionRequestAssistantMessageRefusal>,
        /// The role of the messages author, in this case `assistant`.
        pub role: ChatCompletionRequestAssistantMessageRole,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
        pub name: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub audio: Option<ChatCompletionRequestAssistantMessageAudio>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub tool_calls: Option<ChatCompletionMessageToolCalls>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub function_call: Option<ChatCompletionRequestAssistantMessageFunctionCall>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 兼容厂商扩展（DeepSeek-v4-pro 等）：上一轮 assistant 的思考链文本，thinking 模式下必须回放给服务端。OpenAI 官方忽略此字段。
        pub reasoning_content: Option<String>,
    }
    /// The role of the messages author, in this case `tool`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestToolMessageRole {
        #[serde(rename = "tool")]
        Tool,
    }
    impl ::std::fmt::Display for ChatCompletionRequestToolMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Tool => ::std::write!(__f, "tool"),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestMessageContentPartText>
        for ChatCompletionRequestToolMessageContentPart
    {
        fn from(value: ChatCompletionRequestMessageContentPartText) -> Self {
            ChatCompletionRequestToolMessageContentPart::ChatCompletionRequestMessageContentPartText(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestToolMessageContentPart>
        for ChatCompletionRequestMessageContentPartText
    {
        type Error = ChatCompletionRequestToolMessageContentPart;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestToolMessageContentPart,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestToolMessageContentPart::ChatCompletionRequestMessageContentPartText(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestToolMessageContentPart {
        ChatCompletionRequestMessageContentPartText(ChatCompletionRequestMessageContentPartText),
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// The contents of the tool message.
    pub enum ChatCompletionRequestToolMessageContent {
        ChatCompletionRequestToolMessageContentVariant0(String),
        ChatCompletionRequestToolMessageContentVariant1(
            Vec<ChatCompletionRequestToolMessageContentPart>,
        ),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestToolMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionRequestToolMessageContent::ChatCompletionRequestToolMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestToolMessageContent> for String {
        type Error = ChatCompletionRequestToolMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestToolMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestToolMessageContent::ChatCompletionRequestToolMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Vec<ChatCompletionRequestToolMessageContentPart>>
        for ChatCompletionRequestToolMessageContent
    {
        fn from(value: Vec<ChatCompletionRequestToolMessageContentPart>) -> Self {
            ChatCompletionRequestToolMessageContent::ChatCompletionRequestToolMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestToolMessageContent>
        for Vec<ChatCompletionRequestToolMessageContentPart>
    {
        type Error = ChatCompletionRequestToolMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestToolMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestToolMessageContent::ChatCompletionRequestToolMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Tool message
    pub struct ChatCompletionRequestToolMessage {
        /// The role of the messages author, in this case `tool`.
        pub role: ChatCompletionRequestToolMessageRole,
        /// The contents of the tool message.
        pub content: ChatCompletionRequestToolMessageContent,
        /// Tool call that this message is responding to.
        pub tool_call_id: String,
    }
    /// The role of the messages author, in this case `function`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionRequestFunctionMessageRole {
        #[serde(rename = "function")]
        Function,
    }
    impl ::std::fmt::Display for ChatCompletionRequestFunctionMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Function => ::std::write!(__f, "function"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestFunctionMessageContent {
        ChatCompletionRequestFunctionMessageContentVariant0(String),
        ChatCompletionRequestFunctionMessageContentVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionRequestFunctionMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionRequestFunctionMessageContent::ChatCompletionRequestFunctionMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestFunctionMessageContent> for String {
        type Error = ChatCompletionRequestFunctionMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestFunctionMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestFunctionMessageContent::ChatCompletionRequestFunctionMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for ChatCompletionRequestFunctionMessageContent
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionRequestFunctionMessageContent::ChatCompletionRequestFunctionMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestFunctionMessageContent>
        for Option<::serde_json::Value>
    {
        type Error = ChatCompletionRequestFunctionMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestFunctionMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestFunctionMessageContent::ChatCompletionRequestFunctionMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[deprecated]
    /// # Function message
    pub struct ChatCompletionRequestFunctionMessage {
        /// The role of the messages author, in this case `function`.
        pub role: ChatCompletionRequestFunctionMessageRole,
        pub content: ChatCompletionRequestFunctionMessageContent,
        /// The name of the function to call.
        pub name: String,
    }
    impl ::std::convert::From<ChatCompletionRequestDeveloperMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestDeveloperMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestDeveloperMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage>
        for ChatCompletionRequestDeveloperMessage
    {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestDeveloperMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestSystemMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestSystemMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestSystemMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage> for ChatCompletionRequestSystemMessage {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestSystemMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestUserMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestUserMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestUserMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage> for ChatCompletionRequestUserMessage {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestUserMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestAssistantMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestAssistantMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestAssistantMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage>
        for ChatCompletionRequestAssistantMessage
    {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestAssistantMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestToolMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestToolMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestToolMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage> for ChatCompletionRequestToolMessage {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestToolMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionRequestFunctionMessage> for ChatCompletionRequestMessage {
        fn from(value: ChatCompletionRequestFunctionMessage) -> Self {
            ChatCompletionRequestMessage::ChatCompletionRequestFunctionMessage(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionRequestMessage>
        for ChatCompletionRequestFunctionMessage
    {
        type Error = ChatCompletionRequestMessage;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionRequestMessage,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionRequestMessage::ChatCompletionRequestFunctionMessage(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionRequestMessage {
        ChatCompletionRequestDeveloperMessage(ChatCompletionRequestDeveloperMessage),
        ChatCompletionRequestSystemMessage(ChatCompletionRequestSystemMessage),
        ChatCompletionRequestUserMessage(ChatCompletionRequestUserMessage),
        ChatCompletionRequestAssistantMessage(ChatCompletionRequestAssistantMessage),
        ChatCompletionRequestToolMessage(ChatCompletionRequestToolMessage),
        ChatCompletionRequestFunctionMessage(ChatCompletionRequestFunctionMessage),
    }
    /// The type of location approximation. Always `approximate`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionRequestWebSearchOptionsUserLocationType {
        #[serde(rename = "approximate")]
        Approximate,
    }
    impl ::std::fmt::Display for CreateChatCompletionRequestWebSearchOptionsUserLocationType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Approximate => ::std::write!(__f, "approximate"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Approximate location parameters for the search.
    pub struct CreateChatCompletionRequestWebSearchOptionsUserLocation {
        /// The type of location approximation. Always `approximate`.
        pub r#type: CreateChatCompletionRequestWebSearchOptionsUserLocationType,
        pub approximate: WebSearchLocation,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// # Web search
    /// This tool searches the web for relevant results to use in a response.
    /// Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).
    pub struct CreateChatCompletionRequestWebSearchOptions {
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Approximate location parameters for the search.
        pub user_location: Option<CreateChatCompletionRequestWebSearchOptionsUserLocation>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub search_context_size: Option<WebSearchContextSize>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// An object specifying the format that the model must output.
    ///
    /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
    /// Structured Outputs which ensures the model will match your supplied JSON
    /// schema. Learn more in the [Structured Outputs
    /// guide](/docs/guides/structured-outputs).
    ///
    /// Setting to `{ "type": "json_object" }` enables the older JSON mode, which
    /// ensures the message the model generates is valid JSON. Using `json_schema`
    /// is preferred for models that support it.
    pub enum CreateChatCompletionRequestResponseFormat {
        ResponseFormatText(ResponseFormatText),
        ResponseFormatJsonSchema(ResponseFormatJsonSchema),
        ResponseFormatJsonObject(ResponseFormatJsonObject),
    }
    impl ::std::convert::From<ResponseFormatText> for CreateChatCompletionRequestResponseFormat {
        fn from(value: ResponseFormatText) -> Self {
            CreateChatCompletionRequestResponseFormat::ResponseFormatText(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestResponseFormat> for ResponseFormatText {
        type Error = CreateChatCompletionRequestResponseFormat;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestResponseFormat,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestResponseFormat::ResponseFormatText(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ResponseFormatJsonSchema> for CreateChatCompletionRequestResponseFormat {
        fn from(value: ResponseFormatJsonSchema) -> Self {
            CreateChatCompletionRequestResponseFormat::ResponseFormatJsonSchema(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestResponseFormat>
        for ResponseFormatJsonSchema
    {
        type Error = CreateChatCompletionRequestResponseFormat;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestResponseFormat,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestResponseFormat::ResponseFormatJsonSchema(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ResponseFormatJsonObject> for CreateChatCompletionRequestResponseFormat {
        fn from(value: ResponseFormatJsonObject) -> Self {
            CreateChatCompletionRequestResponseFormat::ResponseFormatJsonObject(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestResponseFormat>
        for ResponseFormatJsonObject
    {
        type Error = CreateChatCompletionRequestResponseFormat;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestResponseFormat,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestResponseFormat::ResponseFormatJsonObject(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
    /// `opus`, or `pcm16`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionRequestAudioFormat {
        #[serde(rename = "wav")]
        Wav,
        #[serde(rename = "aac")]
        Aac,
        #[serde(rename = "mp3")]
        Mp3,
        #[serde(rename = "flac")]
        Flac,
        #[serde(rename = "opus")]
        Opus,
        #[serde(rename = "pcm16")]
        Pcm16,
    }
    impl ::std::fmt::Display for CreateChatCompletionRequestAudioFormat {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Wav => ::std::write!(__f, "wav"),
                Self::Aac => ::std::write!(__f, "aac"),
                Self::Mp3 => ::std::write!(__f, "mp3"),
                Self::Flac => ::std::write!(__f, "flac"),
                Self::Opus => ::std::write!(__f, "opus"),
                Self::Pcm16 => ::std::write!(__f, "pcm16"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Parameters for audio output. Required when audio output is requested with
    /// `modalities: ["audio"]`. [Learn more](/docs/guides/audio).
    pub struct CreateChatCompletionRequestAudio {
        pub voice: VoiceIdsOrCustomVoice,
        /// Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
        /// `opus`, or `pcm16`.
        pub format: CreateChatCompletionRequestAudioFormat,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    /// Configuration for a [Predicted Output](/docs/guides/predicted-outputs),
    /// which can greatly improve response times when large parts of the model
    /// response are known ahead of time. This is most common when you are
    /// regenerating a file with only minor changes to most of the content.
    pub enum CreateChatCompletionRequestPrediction {
        PredictionContent(PredictionContent),
    }
    impl ::std::convert::From<PredictionContent> for CreateChatCompletionRequestPrediction {
        fn from(value: PredictionContent) -> Self {
            CreateChatCompletionRequestPrediction::PredictionContent(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestPrediction> for PredictionContent {
        type Error = CreateChatCompletionRequestPrediction;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestPrediction,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestPrediction::PredictionContent(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionRequestTools {
        ChatCompletionTool(ChatCompletionTool),
        CustomToolChatCompletions(CustomToolChatCompletions),
    }
    impl ::std::convert::From<ChatCompletionTool> for CreateChatCompletionRequestTools {
        fn from(value: ChatCompletionTool) -> Self {
            CreateChatCompletionRequestTools::ChatCompletionTool(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTools> for ChatCompletionTool {
        type Error = CreateChatCompletionRequestTools;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTools,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTools::ChatCompletionTool(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<CustomToolChatCompletions> for CreateChatCompletionRequestTools {
        fn from(value: CustomToolChatCompletions) -> Self {
            CreateChatCompletionRequestTools::CustomToolChatCompletions(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestTools> for CustomToolChatCompletions {
        type Error = CreateChatCompletionRequestTools;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestTools,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestTools::CustomToolChatCompletions(inner) => {
                    ::std::result::Result::Ok(inner)
                }
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionRequestFunctionCallVariant0 {
        #[serde(rename = "none")]
        None,
        #[serde(rename = "auto")]
        Auto,
    }
    impl ::std::fmt::Display for CreateChatCompletionRequestFunctionCallVariant0 {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::None => ::std::write!(__f, "none"),
                Self::Auto => ::std::write!(__f, "auto"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    #[deprecated]
    /// Deprecated in favor of `tool_choice`.
    ///
    /// Controls which (if any) function is called by the model.
    ///
    /// `none` means the model will not call a function and instead generates a
    /// message.
    ///
    /// `auto` means the model can pick between generating a message or calling a
    /// function.
    ///
    /// Specifying a particular function via `{"name": "my_function"}` forces the
    /// model to call that function.
    ///
    /// `none` is the default when no functions are present. `auto` is the default
    /// if functions are present.
    pub enum CreateChatCompletionRequestFunctionCall {
        CreateChatCompletionRequestFunctionCallVariant0(
            CreateChatCompletionRequestFunctionCallVariant0,
        ),
        ChatCompletionFunctionCallOption(ChatCompletionFunctionCallOption),
    }
    impl ::std::convert::From<CreateChatCompletionRequestFunctionCallVariant0>
        for CreateChatCompletionRequestFunctionCall
    {
        fn from(value: CreateChatCompletionRequestFunctionCallVariant0) -> Self {
            CreateChatCompletionRequestFunctionCall::CreateChatCompletionRequestFunctionCallVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestFunctionCall>
        for CreateChatCompletionRequestFunctionCallVariant0
    {
        type Error = CreateChatCompletionRequestFunctionCall;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestFunctionCall,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestFunctionCall::CreateChatCompletionRequestFunctionCallVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<ChatCompletionFunctionCallOption>
        for CreateChatCompletionRequestFunctionCall
    {
        fn from(value: ChatCompletionFunctionCallOption) -> Self {
            CreateChatCompletionRequestFunctionCall::ChatCompletionFunctionCallOption(value)
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionRequestFunctionCall>
        for ChatCompletionFunctionCallOption
    {
        type Error = CreateChatCompletionRequestFunctionCall;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionRequestFunctionCall,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionRequestFunctionCall::ChatCompletionFunctionCallOption(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct CreateChatCompletionRequest {
        #[serde(skip_serializing_if = "Option::is_none")]
        pub metadata: Option<Metadata>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_logprobs: Option<CreateChatCompletionRequestTopLogprobs>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub temperature: Option<CreateChatCompletionRequestTemperature>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub top_p: Option<CreateChatCompletionRequestTopP>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.
        /// A stable identifier for your end-users.
        /// Used to boost cache hit rates by better bucketing similar requests and  to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        #[deprecated]
        pub user: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
        /// The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers).
        pub safety_identifier: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching).
        pub prompt_cache_key: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub service_tier: Option<ServiceTier>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub prompt_cache_retention: Option<CreateChatCompletionRequestPromptCacheRetention>,
        /// A list of messages comprising the conversation so far. Depending on the
        /// [model](/docs/models) you use, different message types (modalities) are
        /// supported, like [text](/docs/guides/text-generation),
        /// [images](/docs/guides/vision), and [audio](/docs/guides/audio).
        pub messages: Vec<ChatCompletionRequestMessage>,
        pub model: ModelIdsShared,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub modalities: Option<ResponseModalities>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub verbosity: Option<Verbosity>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub reasoning_effort: Option<ReasoningEffort>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).
        pub max_completion_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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.
        pub frequency_penalty: Option<f64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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.
        pub presence_penalty: Option<f64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This tool searches the web for relevant results to use in a response.
        /// Learn more about the [web search tool](/docs/guides/tools-web-search?api-mode=chat).
        pub web_search_options: Option<CreateChatCompletionRequestWebSearchOptions>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// An object specifying the format that the model must output.
        ///
        /// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
        /// Structured Outputs which ensures the model will match your supplied JSON
        /// schema. Learn more in the [Structured Outputs
        /// guide](/docs/guides/structured-outputs).
        ///
        /// Setting to `{ "type": "json_object" }` enables the older JSON mode, which
        /// ensures the message the model generates is valid JSON. Using `json_schema`
        /// is preferred for models that support it.
        pub response_format: Option<CreateChatCompletionRequestResponseFormat>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Parameters for audio output. Required when audio output is requested with
        /// `modalities: ["audio"]`. [Learn more](/docs/guides/audio).
        pub audio: Option<CreateChatCompletionRequestAudio>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Whether or not to store the output of this chat completion request for
        /// use in our [model distillation](/docs/guides/distillation) or
        /// [evals](/docs/guides/evals) products.
        ///
        /// Supports text and image inputs. Note: image inputs over 8MB will be dropped.
        pub store: Option<bool>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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).
        /// See the [Streaming section below](/docs/api-reference/chat/streaming)
        /// for more information, along with the [streaming responses](/docs/guides/streaming-responses)
        /// guide for more information on how to handle the streaming events.
        pub stream: Option<bool>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub stop: Option<StopConfiguration>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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. Mathematically,
        /// the bias is added to the logits generated by the model prior to sampling.
        /// The exact effect will vary per model, but values between -1 and 1 should
        /// decrease or increase likelihood of selection; values like -100 or 100
        /// should result in a ban or exclusive selection of the relevant token.
        pub logit_bias: Option<::std::collections::BTreeMap<String, i64>>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 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`.
        pub logprobs: Option<bool>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// The maximum number of [tokens](/tokenizer) that can be generated in the
        /// chat completion. This value can be used to control
        /// [costs](https://openai.com/api/pricing/) for text generated via API.
        ///
        /// This value is now deprecated in favor of `max_completion_tokens`, and is
        /// not compatible with [o-series models](/docs/guides/reasoning).
        #[deprecated]
        pub max_tokens: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
        pub n: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Configuration for a [Predicted Output](/docs/guides/predicted-outputs),
        /// which can greatly improve response times when large parts of the model
        /// response are known ahead of time. This is most common when you are
        /// regenerating a file with only minor changes to most of the content.
        pub prediction: Option<CreateChatCompletionRequestPrediction>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This feature is in Beta.
        /// 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.
        #[deprecated]
        pub seed: Option<i64>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub stream_options: Option<ChatCompletionStreamOptions>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// A list of tools the model may call. You can provide either
        /// [custom tools](/docs/guides/function-calling#custom-tools) or
        /// [function tools](/docs/guides/function-calling).
        pub tools: Option<Vec<CreateChatCompletionRequestTools>>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub tool_choice: Option<ChatCompletionToolChoiceOption>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub parallel_tool_calls: Option<ParallelToolCalls>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Deprecated in favor of `tool_choice`.
        ///
        /// Controls which (if any) function is called by the model.
        ///
        /// `none` means the model will not call a function and instead generates a
        /// message.
        ///
        /// `auto` means the model can pick between generating a message or calling a
        /// function.
        ///
        /// Specifying a particular function via `{"name": "my_function"}` forces the
        /// model to call that function.
        ///
        /// `none` is the default when no functions are present. `auto` is the default
        /// if functions are present.
        #[deprecated]
        pub function_call: Option<CreateChatCompletionRequestFunctionCall>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Deprecated in favor of `tools`.
        ///
        /// A list of functions the model may generate JSON inputs for.
        #[deprecated]
        pub functions: Option<Vec<ChatCompletionFunctions>>,
    }
    /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
    /// `length` if the maximum number of tokens specified in the request was reached,
    /// `content_filter` if content was omitted due to a flag from our content filters,
    /// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionResponseChoicesFinishReason {
        #[serde(rename = "stop")]
        Stop,
        #[serde(rename = "length")]
        Length,
        #[serde(rename = "tool_calls")]
        ToolCalls,
        #[serde(rename = "content_filter")]
        ContentFilter,
        #[serde(rename = "function_call")]
        FunctionCall,
    }
    impl ::std::fmt::Display for CreateChatCompletionResponseChoicesFinishReason {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Stop => ::std::write!(__f, "stop"),
                Self::Length => ::std::write!(__f, "length"),
                Self::ToolCalls => ::std::write!(__f, "tool_calls"),
                Self::ContentFilter => ::std::write!(__f, "content_filter"),
                Self::FunctionCall => ::std::write!(__f, "function_call"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionResponseMessageContent {
        ChatCompletionResponseMessageContentVariant0(String),
        ChatCompletionResponseMessageContentVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionResponseMessageContent {
        fn from(value: String) -> Self {
            ChatCompletionResponseMessageContent::ChatCompletionResponseMessageContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageContent> for String {
        type Error = ChatCompletionResponseMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageContent::ChatCompletionResponseMessageContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ChatCompletionResponseMessageContent {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionResponseMessageContent::ChatCompletionResponseMessageContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageContent> for Option<::serde_json::Value> {
        type Error = ChatCompletionResponseMessageContent;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageContent,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageContent::ChatCompletionResponseMessageContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionResponseMessageRefusal {
        ChatCompletionResponseMessageRefusalVariant0(String),
        ChatCompletionResponseMessageRefusalVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<String> for ChatCompletionResponseMessageRefusal {
        fn from(value: String) -> Self {
            ChatCompletionResponseMessageRefusal::ChatCompletionResponseMessageRefusalVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageRefusal> for String {
        type Error = ChatCompletionResponseMessageRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageRefusal::ChatCompletionResponseMessageRefusalVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ChatCompletionResponseMessageRefusal {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionResponseMessageRefusal::ChatCompletionResponseMessageRefusalVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageRefusal> for Option<::serde_json::Value> {
        type Error = ChatCompletionResponseMessageRefusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageRefusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageRefusal::ChatCompletionResponseMessageRefusalVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    /// The type of the URL citation. Always `url_citation`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionResponseMessageAnnotationsType {
        #[serde(rename = "url_citation")]
        UrlCitation,
    }
    impl ::std::fmt::Display for ChatCompletionResponseMessageAnnotationsType {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::UrlCitation => ::std::write!(__f, "url_citation"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// A URL citation when using web search.
    pub struct ChatCompletionResponseMessageAnnotationsUrlCitation {
        /// The index of the last character of the URL citation in the message.
        pub end_index: i64,
        /// The index of the first character of the URL citation in the message.
        pub start_index: i64,
        /// The URL of the web resource.
        pub url: String,
        /// The title of the web resource.
        pub title: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// A URL citation when using web search.
    pub struct ChatCompletionResponseMessageAnnotations {
        /// The type of the URL citation. Always `url_citation`.
        pub r#type: ChatCompletionResponseMessageAnnotationsType,
        /// A URL citation when using web search.
        pub url_citation: ChatCompletionResponseMessageAnnotationsUrlCitation,
    }
    /// The role of the author of this message.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum ChatCompletionResponseMessageRole {
        #[serde(rename = "assistant")]
        Assistant,
    }
    impl ::std::fmt::Display for ChatCompletionResponseMessageRole {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::Assistant => ::std::write!(__f, "assistant"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[deprecated]
    /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
    pub struct ChatCompletionResponseMessageFunctionCall {
        /// 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.
        pub arguments: String,
        /// The name of the function to call.
        pub name: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// If the audio output modality is requested, this object contains data
    /// about the audio response from the model. [Learn more](/docs/guides/audio).
    pub struct ChatCompletionResponseMessageAudioVariant0 {
        /// Unique identifier for this audio response.
        pub id: String,
        /// The Unix timestamp (in seconds) for when this audio response will
        /// no longer be accessible on the server for use in multi-turn
        /// conversations.
        pub expires_at: i64,
        /// Base64 encoded audio bytes generated by the model, in the format
        /// specified in the request.
        pub data: String,
        /// Transcript of the audio generated by the model.
        pub transcript: String,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum ChatCompletionResponseMessageAudio {
        ChatCompletionResponseMessageAudioVariant0(ChatCompletionResponseMessageAudioVariant0),
        ChatCompletionResponseMessageAudioVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<ChatCompletionResponseMessageAudioVariant0>
        for ChatCompletionResponseMessageAudio
    {
        fn from(value: ChatCompletionResponseMessageAudioVariant0) -> Self {
            ChatCompletionResponseMessageAudio::ChatCompletionResponseMessageAudioVariant0(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageAudio>
        for ChatCompletionResponseMessageAudioVariant0
    {
        type Error = ChatCompletionResponseMessageAudio;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageAudio,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageAudio::ChatCompletionResponseMessageAudioVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>> for ChatCompletionResponseMessageAudio {
        fn from(value: Option<::serde_json::Value>) -> Self {
            ChatCompletionResponseMessageAudio::ChatCompletionResponseMessageAudioVariant1(value)
        }
    }
    impl ::std::convert::TryFrom<ChatCompletionResponseMessageAudio> for Option<::serde_json::Value> {
        type Error = ChatCompletionResponseMessageAudio;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: ChatCompletionResponseMessageAudio,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                ChatCompletionResponseMessageAudio::ChatCompletionResponseMessageAudioVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// A chat completion message generated by the model.
    pub struct ChatCompletionResponseMessage {
        pub content: ChatCompletionResponseMessageContent,
        pub refusal: ChatCompletionResponseMessageRefusal,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub tool_calls: Option<ChatCompletionMessageToolCalls>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Annotations for the message, when applicable, as when using the
        /// [web search tool](/docs/guides/tools-web-search?api-mode=chat).
        pub annotations: Option<Vec<ChatCompletionResponseMessageAnnotations>>,
        /// The role of the author of this message.
        pub role: ChatCompletionResponseMessageRole,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
        #[deprecated]
        pub function_call: Option<ChatCompletionResponseMessageFunctionCall>,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub audio: Option<ChatCompletionResponseMessageAudio>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionResponseChoicesLogprobsVariant0Content {
        CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant0(
            Vec<ChatCompletionTokenLogprob>,
        ),
        CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant1(
            Option<::serde_json::Value>,
        ),
    }
    impl ::std::convert::From<Vec<ChatCompletionTokenLogprob>>
        for CreateChatCompletionResponseChoicesLogprobsVariant0Content
    {
        fn from(value: Vec<ChatCompletionTokenLogprob>) -> Self {
            CreateChatCompletionResponseChoicesLogprobsVariant0Content::CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobsVariant0Content>
        for Vec<ChatCompletionTokenLogprob>
    {
        type Error = CreateChatCompletionResponseChoicesLogprobsVariant0Content;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobsVariant0Content,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobsVariant0Content::CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateChatCompletionResponseChoicesLogprobsVariant0Content
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionResponseChoicesLogprobsVariant0Content::CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobsVariant0Content>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionResponseChoicesLogprobsVariant0Content;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobsVariant0Content,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobsVariant0Content::CreateChatCompletionResponseChoicesLogprobsVariant0ContentVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionResponseChoicesLogprobsVariant0Refusal {
        CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant0(
            Vec<ChatCompletionTokenLogprob>,
        ),
        CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant1(
            Option<::serde_json::Value>,
        ),
    }
    impl ::std::convert::From<Vec<ChatCompletionTokenLogprob>>
        for CreateChatCompletionResponseChoicesLogprobsVariant0Refusal
    {
        fn from(value: Vec<ChatCompletionTokenLogprob>) -> Self {
            CreateChatCompletionResponseChoicesLogprobsVariant0Refusal::CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobsVariant0Refusal>
        for Vec<ChatCompletionTokenLogprob>
    {
        type Error = CreateChatCompletionResponseChoicesLogprobsVariant0Refusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobsVariant0Refusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobsVariant0Refusal::CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateChatCompletionResponseChoicesLogprobsVariant0Refusal
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionResponseChoicesLogprobsVariant0Refusal::CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobsVariant0Refusal>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionResponseChoicesLogprobsVariant0Refusal;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobsVariant0Refusal,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobsVariant0Refusal::CreateChatCompletionResponseChoicesLogprobsVariant0RefusalVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Log probability information for the choice.
    pub struct CreateChatCompletionResponseChoicesLogprobsVariant0 {
        pub content: CreateChatCompletionResponseChoicesLogprobsVariant0Content,
        pub refusal: CreateChatCompletionResponseChoicesLogprobsVariant0Refusal,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    #[serde(untagged)]
    pub enum CreateChatCompletionResponseChoicesLogprobs {
        CreateChatCompletionResponseChoicesLogprobsVariant0(
            CreateChatCompletionResponseChoicesLogprobsVariant0,
        ),
        CreateChatCompletionResponseChoicesLogprobsVariant1(Option<::serde_json::Value>),
    }
    impl ::std::convert::From<CreateChatCompletionResponseChoicesLogprobsVariant0>
        for CreateChatCompletionResponseChoicesLogprobs
    {
        fn from(value: CreateChatCompletionResponseChoicesLogprobsVariant0) -> Self {
            CreateChatCompletionResponseChoicesLogprobs::CreateChatCompletionResponseChoicesLogprobsVariant0(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobs>
        for CreateChatCompletionResponseChoicesLogprobsVariant0
    {
        type Error = CreateChatCompletionResponseChoicesLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobs::CreateChatCompletionResponseChoicesLogprobsVariant0(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    impl ::std::convert::From<Option<::serde_json::Value>>
        for CreateChatCompletionResponseChoicesLogprobs
    {
        fn from(value: Option<::serde_json::Value>) -> Self {
            CreateChatCompletionResponseChoicesLogprobs::CreateChatCompletionResponseChoicesLogprobsVariant1(
                value,
            )
        }
    }
    impl ::std::convert::TryFrom<CreateChatCompletionResponseChoicesLogprobs>
        for Option<::serde_json::Value>
    {
        type Error = CreateChatCompletionResponseChoicesLogprobs;
        /// # Errors
        ///
        /// Returns the original enum value if it does not match the
        /// `#variant_ident` variant.
        fn try_from(
            value: CreateChatCompletionResponseChoicesLogprobs,
        ) -> ::std::result::Result<Self, Self::Error> {
            match value {
                CreateChatCompletionResponseChoicesLogprobs::CreateChatCompletionResponseChoicesLogprobsVariant1(
                    inner,
                ) => ::std::result::Result::Ok(inner),
                other => ::std::result::Result::Err(other),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct CreateChatCompletionResponseChoices {
        /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
        /// `length` if the maximum number of tokens specified in the request was reached,
        /// `content_filter` if content was omitted due to a flag from our content filters,
        /// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
        pub finish_reason: CreateChatCompletionResponseChoicesFinishReason,
        /// The index of the choice in the list of choices.
        pub index: i64,
        pub message: ChatCompletionResponseMessage,
        pub logprobs: CreateChatCompletionResponseChoicesLogprobs,
    }
    /// The object type, which is always `chat.completion`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, ::serde::Serialize, ::serde::Deserialize)]
    pub enum CreateChatCompletionResponseObject {
        #[serde(rename = "chat.completion")]
        ChatCompletion,
    }
    impl ::std::fmt::Display for CreateChatCompletionResponseObject {
        fn fmt(&self, __f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
            match self {
                Self::ChatCompletion => ::std::write!(__f, "chat.completion"),
            }
        }
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// Represents a chat completion response returned by model, based on the provided input.
    pub struct CreateChatCompletionResponse {
        /// A unique identifier for the chat completion.
        pub id: String,
        /// A list of chat completion choices. Can be more than one if `n` is greater than 1.
        pub choices: Vec<CreateChatCompletionResponseChoices>,
        /// The Unix timestamp (in seconds) of when the chat completion was created.
        pub created: i64,
        /// The model used for the chat completion.
        pub model: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub service_tier: Option<ServiceTier>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// This fingerprint represents the backend configuration that the model runs with.
        ///
        /// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
        #[deprecated]
        pub system_fingerprint: Option<String>,
        /// The object type, which is always `chat.completion`.
        pub object: CreateChatCompletionResponseObject,
        #[serde(skip_serializing_if = "Option::is_none")]
        pub usage: Option<CompletionUsage>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    pub struct OpenAiErrorResponseError {
        /// 人类可读的错误描述。
        pub message: String,
        /// OpenAI 错误大类：invalid_request_error / authentication_error / permission_error / not_found_error / rate_limit_error / insufficient_quota / server_error / overloaded 等。
        pub r#type: String,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 细化错误代码（如 model_not_found / context_length_exceeded / insufficient_quota）。
        pub code: Option<String>,
        #[serde(skip_serializing_if = "Option::is_none")]
        /// 引发错误的请求参数名（如有）。
        pub param: Option<String>,
    }
    #[derive(Debug, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)]
    /// OpenAI 4xx/5xx 错误响应。`error.code` / `param` 在不同错误类型上可能缺省。
    pub struct OpenAiErrorResponse {
        pub error: OpenAiErrorResponseError,
    }
}
pub mod operations {
    #![allow(deprecated)]
    #![allow(unreachable_patterns)]
    #![allow(non_camel_case_types)]
    #![allow(non_snake_case)]
    #![allow(clippy::all, clippy::pedantic)]
    pub mod models {
        pub mod get {
            #[derive(Debug, Clone, PartialEq)]
            /// # Lists the currently available models, and provides basic information about each one such as the owner and availability.
            pub struct Request {}
            impl Request {
                /// `GET /models`
                /// Operation ID: `listModels`.
                pub const METHOD: ::http::Method = ::http::Method::GET;
                /// URL path template, with `{name}` placeholders for path
                /// parameters. Rendering into a concrete URL is the caller's
                /// responsibility.
                pub const PATH_TEMPLATE: &'static str = "/models";
                /// Security requirement declared by the spec for this
                /// operation. Outer slice encodes OR alternatives; inner
                /// slice encodes AND requirements within one alternative.
                /// Empty outer slice means "public, no auth required".
                pub const SECURITY: &'static [&'static [&'static str]] = &[&["ApiKeyAuth"]];
                /// Wraps this request with an `Accept` header override.
                ///
                /// The generated [`::toac::MakeRequest`] impl auto-emits an
                /// `Accept` header listing every response media type
                /// declared in the spec. Use this method to steer content
                /// negotiation to one specific type (for example, asking
                /// for `text/event-stream` to land on a streaming branch).
                pub fn with_accept(self, accept: ::http::HeaderValue) -> ::toac::WithAccept<Self> {
                    ::toac::WithAccept::new(self, accept)
                }
            }
            impl ::toac::MakeRequest for Request {
                type Error = ::std::convert::Infallible;
                fn make_request(
                    self,
                ) -> impl ::std::future::Future<
                    Output = ::std::result::Result<::toac::Request, Self::Error>,
                > + Send {
                    async move {
                        let mut __path = ::std::string::String::new();
                        __path.push_str("/models");
                        let mut __builder = ::http::Request::builder()
                            .method(::http::Method::GET)
                            .uri(__path);
                        __builder = __builder.header(
                            ::http::header::ACCEPT,
                            ::http::HeaderValue::from_static("application/json"),
                        );
                        let mut __request = __builder
                            .body(::toac::body::Body::empty())
                            .expect("valid generated HTTP request");
                        __request
                            .extensions_mut()
                            .insert(::toac::OperationSecurity(&[&["ApiKeyAuth"]]));
                        ::std::result::Result::Ok(__request)
                    }
                }
            }
            #[derive(Debug, Clone, PartialEq)]
            pub enum ResponseBody {
                ///OK
                Status200(crate::wire::openai::components::ListModelsResponse),
                ///Bad Request — 请求体格式或字段无效。
                Status400(crate::wire::openai::components::OpenAiErrorResponse),
                ///Unauthorized — API key 缺失 / 无效。
                Status401(crate::wire::openai::components::OpenAiErrorResponse),
                ///Forbidden — 资源访问被拒，可能是配额耗尽。
                Status403(crate::wire::openai::components::OpenAiErrorResponse),
                ///Not Found — 模型 id 不存在或被弃用。
                Status404(crate::wire::openai::components::OpenAiErrorResponse),
                ///Payload Too Large — 请求体超出上游限制。
                Status413(crate::wire::openai::components::OpenAiErrorResponse),
                ///Too Many Requests — 触发 RPM / TPM 限速。
                Status429(crate::wire::openai::components::OpenAiErrorResponse),
                ///Internal Server Error — 上游异常。
                Status500(crate::wire::openai::components::OpenAiErrorResponse),
                ///Bad Gateway — 上游网关异常。
                Status502(crate::wire::openai::components::OpenAiErrorResponse),
                ///Service Unavailable — 上游过载或维护中。
                Status503(crate::wire::openai::components::OpenAiErrorResponse),
            }
            #[derive(Debug, Clone, PartialEq)]
            pub struct Response {
                /// Response headers as received from the wire.
                pub headers: ::http::HeaderMap,
                /// Decoded body, dispatched by status (and Content-Type
                /// when the spec declares multiple codecs per status).
                pub body: ResponseBody,
            }
            impl ::toac::ParseResponse for Response {
                type Error = ::toac::DecodeError;
                fn parse_response<__B>(
                    response: ::http::Response<__B>,
                ) -> impl ::std::future::Future<
                    Output = ::std::result::Result<Self, Self::Error>,
                > + ::std::marker::Send
                where
                    __B: ::http_body::Body<Data = ::bytes::Bytes>
                        + ::std::marker::Send
                        + ::std::marker::Sync
                        + 'static,
                    __B::Error: ::std::convert::Into<::toac::BoxError>,
                {
                    async move {
                        let (__parts, __body) = response.into_parts();
                        let __status = __parts.status;
                        let __headers = __parts.headers;
                        match __status.as_u16() {
                            200u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status200(__value),
                                });
                            }
                            400u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status400(__value),
                                });
                            }
                            401u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status401(__value),
                                });
                            }
                            403u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status403(__value),
                                });
                            }
                            404u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status404(__value),
                                });
                            }
                            413u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status413(__value),
                                });
                            }
                            429u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status429(__value),
                                });
                            }
                            500u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status500(__value),
                                });
                            }
                            502u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status502(__value),
                                });
                            }
                            503u16 => {
                                let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                let __value = ::toac::body::codec::decode_body(&__decoder, __body)
                                    .await
                                    .map_err(|e| {
                                        ::toac::DecodeError::Codec(::std::convert::Into::into(e))
                                    })?;
                                return ::std::result::Result::Ok(Self {
                                    headers: __headers,
                                    body: ResponseBody::Status503(__value),
                                });
                            }
                            _ => {}
                        }
                        ::std::mem::drop(__body);
                        return ::std::result::Result::Err(::toac::DecodeError::UnexpectedStatus(
                            __status,
                        ));
                    }
                }
            }
            impl ::toac::Operation for Request {
                type Response = Response;
            }
        }
    }
    pub mod chat {
        pub mod completions {
            pub mod post {
                #[derive(Debug, Clone, PartialEq)]
                /**
                # **Starting a new project?** We recommend trying [Responses](/docs/api-reference/responses)
                to take advantage of the latest OpenAI platform features. Compare
                [Chat Completions with Responses](/docs/guides/responses-vs-chat-completions?api-mode=responses).

                ---

                Creates a model response for the given chat conversation. Learn more in the
                [text generation](/docs/guides/text-generation), [vision](/docs/guides/vision),
                and [audio](/docs/guides/audio) guides.

                Parameter support can differ depending on the model used to generate the
                response, particularly for newer reasoning models. Parameters that are only
                supported for reasoning models are noted below. For the current state of
                unsupported parameters in reasoning models,
                [refer to the reasoning guide](/docs/guides/reasoning).

                Returns a chat completion object, or a streamed sequence of chat completion
                chunk objects if the request is streamed.
                */
                pub struct Request {
                    pub body: crate::wire::openai::components::CreateChatCompletionRequest,
                }
                impl Request {
                    /// `POST /chat/completions`
                    /// Operation ID: `createChatCompletion`.
                    pub const METHOD: ::http::Method = ::http::Method::POST;
                    /// URL path template, with `{name}` placeholders for path
                    /// parameters. Rendering into a concrete URL is the caller's
                    /// responsibility.
                    pub const PATH_TEMPLATE: &'static str = "/chat/completions";
                    /// Security requirement declared by the spec for this
                    /// operation. Outer slice encodes OR alternatives; inner
                    /// slice encodes AND requirements within one alternative.
                    /// Empty outer slice means "public, no auth required".
                    pub const SECURITY: &'static [&'static [&'static str]] = &[&["ApiKeyAuth"]];
                    /// Wraps this request with an `Accept` header override.
                    ///
                    /// The generated [`::toac::MakeRequest`] impl auto-emits an
                    /// `Accept` header listing every response media type
                    /// declared in the spec. Use this method to steer content
                    /// negotiation to one specific type (for example, asking
                    /// for `text/event-stream` to land on a streaming branch).
                    pub fn with_accept(
                        self,
                        accept: ::http::HeaderValue,
                    ) -> ::toac::WithAccept<Self> {
                        ::toac::WithAccept::new(self, accept)
                    }
                }
                impl ::toac::MakeRequest for Request {
                    type Error = ::serde_json::Error;
                    fn make_request(
                        self,
                    ) -> impl ::std::future::Future<
                        Output = ::std::result::Result<::toac::Request, Self::Error>,
                    > + Send {
                        async move {
                            let mut __path = ::std::string::String::new();
                            __path.push_str("/chat/completions");
                            let mut __builder = ::http::Request::builder()
                                .method(::http::Method::POST)
                                .uri(__path);
                            __builder = __builder.header(
                                ::http::header::ACCEPT,
                                ::http::HeaderValue::from_static(
                                    "application/json, text/event-stream",
                                ),
                            );
                            let mut __request = __builder
                                .body(::toac::body::Body::empty())
                                .expect("valid generated HTTP request");
                            __request
                                .extensions_mut()
                                .insert(::toac::OperationSecurity(&[&["ApiKeyAuth"]]));
                            {
                                let __payload = &self.body;
                                ::toac::body::codec::encode_body(
                                    &<::toac::body::codec::json::JsonEncoder as ::std::default::Default>::default(),
                                    __payload,
                                    __request,
                                )
                            }
                        }
                    }
                }
                pub enum ResponseBody {
                    ///OK
                    Status200Json(crate::wire::openai::components::CreateChatCompletionResponse),
                    ///OK
                    Status200Sse(::toac::body::codec::sse::SseEventStream),
                    ///Bad Request — 请求体格式或字段无效。
                    Status400(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Unauthorized — API key 缺失 / 无效。
                    Status401(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Forbidden — 资源访问被拒，可能是配额耗尽。
                    Status403(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Not Found — 模型 id 不存在或被弃用。
                    Status404(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Payload Too Large — 请求体超出上游限制。
                    Status413(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Too Many Requests — 触发 RPM / TPM 限速。
                    Status429(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Internal Server Error — 上游异常。
                    Status500(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Bad Gateway — 上游网关异常。
                    Status502(crate::wire::openai::components::OpenAiErrorResponse),
                    ///Service Unavailable — 上游过载或维护中。
                    Status503(crate::wire::openai::components::OpenAiErrorResponse),
                }
                pub struct Response {
                    /// Response headers as received from the wire.
                    pub headers: ::http::HeaderMap,
                    /// Decoded body, dispatched by status (and Content-Type
                    /// when the spec declares multiple codecs per status).
                    pub body: ResponseBody,
                }
                impl ::toac::ParseResponse for Response {
                    type Error = ::toac::DecodeError;
                    fn parse_response<__B>(
                        response: ::http::Response<__B>,
                    ) -> impl ::std::future::Future<
                        Output = ::std::result::Result<Self, Self::Error>,
                    > + ::std::marker::Send
                    where
                        __B: ::http_body::Body<Data = ::bytes::Bytes>
                            + ::std::marker::Send
                            + ::std::marker::Sync
                            + 'static,
                        __B::Error: ::std::convert::Into<::toac::BoxError>,
                    {
                        async move {
                            let (__parts, __body) = response.into_parts();
                            let __status = __parts.status;
                            let __headers = __parts.headers;
                            let __content_type = __headers
                                .get(::http::header::CONTENT_TYPE)
                                .and_then(|v| v.to_str().ok())
                                .map(|s| {
                                    s.split(';').next().unwrap_or(s).trim().to_ascii_lowercase()
                                });
                            match __status.as_u16() {
                                200u16 => match __content_type.as_deref() {
                                    ::std::option::Option::Some(__ct)
                                        if __ct == "application/json" =>
                                    {
                                        let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                        let __value =
                                            ::toac::body::codec::decode_body(&__decoder, __body)
                                                .await
                                                .map_err(|e| {
                                                    ::toac::DecodeError::Codec(
                                                        ::std::convert::Into::into(e),
                                                    )
                                                })?;
                                        return ::std::result::Result::Ok(Self {
                                            headers: __headers,
                                            body: ResponseBody::Status200Json(__value),
                                        });
                                    }
                                    ::std::option::Option::Some(__ct)
                                        if __ct == "text/event-stream" =>
                                    {
                                        let __decoder = <::toac::body::codec::sse::SseDecoder as ::std::default::Default>::default();
                                        let __value =
                                            ::toac::body::codec::decode_body(&__decoder, __body)
                                                .await
                                                .map_err(|e| {
                                                    ::toac::DecodeError::Codec(
                                                        ::std::convert::Into::into(e),
                                                    )
                                                })?;
                                        return ::std::result::Result::Ok(Self {
                                            headers: __headers,
                                            body: ResponseBody::Status200Sse(__value),
                                        });
                                    }
                                    _ => {
                                        let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                        let __value =
                                            ::toac::body::codec::decode_body(&__decoder, __body)
                                                .await
                                                .map_err(|e| {
                                                    ::toac::DecodeError::Codec(
                                                        ::std::convert::Into::into(e),
                                                    )
                                                })?;
                                        return ::std::result::Result::Ok(Self {
                                            headers: __headers,
                                            body: ResponseBody::Status200Json(__value),
                                        });
                                    }
                                },
                                400u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status400(__value),
                                    });
                                }
                                401u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status401(__value),
                                    });
                                }
                                403u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status403(__value),
                                    });
                                }
                                404u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status404(__value),
                                    });
                                }
                                413u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status413(__value),
                                    });
                                }
                                429u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status429(__value),
                                    });
                                }
                                500u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status500(__value),
                                    });
                                }
                                502u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status502(__value),
                                    });
                                }
                                503u16 => {
                                    let __decoder = <::toac::body::codec::json::JsonDecoder as ::std::default::Default>::default();
                                    let __value =
                                        ::toac::body::codec::decode_body(&__decoder, __body)
                                            .await
                                            .map_err(|e| {
                                                ::toac::DecodeError::Codec(
                                                    ::std::convert::Into::into(e),
                                                )
                                            })?;
                                    return ::std::result::Result::Ok(Self {
                                        headers: __headers,
                                        body: ResponseBody::Status503(__value),
                                    });
                                }
                                _ => {}
                            }
                            ::std::mem::drop(__body);
                            return ::std::result::Result::Err(
                                ::toac::DecodeError::UnexpectedStatus(__status),
                            );
                        }
                    }
                }
                impl ::toac::Operation for Request {
                    type Response = Response;
                }
            }
        }
    }
}
pub mod servers {
    #![allow(deprecated)]
    #![allow(unreachable_patterns)]
    #![allow(non_camel_case_types)]
    #![allow(non_snake_case)]
    #![allow(clippy::all, clippy::pedantic)]
    /// `https://api.openai.com/v1`
    #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
    pub struct ServerOption0;
    impl ::toac::Server for ServerOption0 {
        fn base_url(&self) -> ::std::borrow::Cow<'_, str> {
            ::std::borrow::Cow::Borrowed("https://api.openai.com/v1")
        }
    }
    pub type ApiServer = ServerOption0;
}
pub mod security {
    #![allow(deprecated)]
    #![allow(unreachable_patterns)]
    #![allow(non_camel_case_types)]
    #![allow(non_snake_case)]
    #![allow(clippy::all, clippy::pedantic)]
    /// HTTP Bearer credential. The token is sent as
    /// `Authorization: Bearer <token>`.
    #[derive(Debug, Clone)]
    pub struct AdminApiKeyAuthCredential {
        pub token: ::std::string::String,
    }
    impl AdminApiKeyAuthCredential {
        /// Builds a credential from a raw token value.
        pub fn new<T: ::std::convert::Into<::std::string::String>>(token: T) -> Self {
            Self {
                token: token.into(),
            }
        }
        fn as_runtime(&self) -> ::toac::security::BearerCredential {
            ::toac::security::BearerCredential {
                token: self.token.clone(),
            }
        }
    }
    impl ::toac::SecurityCredential for AdminApiKeyAuthCredential {
        fn apply(
            &self,
            req: ::toac::Request,
        ) -> impl ::std::future::Future<
            Output = ::std::result::Result<::toac::Request, ::toac::BoxError>,
        > + ::std::marker::Send {
            let __cred = self.as_runtime();
            async move { ::toac::SecurityCredential::apply(&__cred, req).await }
        }
    }
    /// HTTP Bearer credential. The token is sent as
    /// `Authorization: Bearer <token>`.
    #[derive(Debug, Clone)]
    pub struct ApiKeyAuthCredential {
        pub token: ::std::string::String,
    }
    impl ApiKeyAuthCredential {
        /// Builds a credential from a raw token value.
        pub fn new<T: ::std::convert::Into<::std::string::String>>(token: T) -> Self {
            Self {
                token: token.into(),
            }
        }
        fn as_runtime(&self) -> ::toac::security::BearerCredential {
            ::toac::security::BearerCredential {
                token: self.token.clone(),
            }
        }
    }
    impl ::toac::SecurityCredential for ApiKeyAuthCredential {
        fn apply(
            &self,
            req: ::toac::Request,
        ) -> impl ::std::future::Future<
            Output = ::std::result::Result<::toac::Request, ::toac::BoxError>,
        > + ::std::marker::Send {
            let __cred = self.as_runtime();
            async move { ::toac::SecurityCredential::apply(&__cred, req).await }
        }
    }
    /// Aggregate of every credential the spec's security schemes
    /// might need. Each field is optional — callers populate only
    /// the schemes they actually use. Build through
    /// [`AuthConfig::builder`].
    #[derive(Debug, Clone, Default)]
    pub struct AuthConfig {
        pub admin_api_key_auth: ::std::option::Option<AdminApiKeyAuthCredential>,
        pub api_key_auth: ::std::option::Option<ApiKeyAuthCredential>,
    }
    impl AuthConfig {
        /// Starts a fluent builder for [`AuthConfig`]. Each setter
        /// is named after the scheme's key in
        /// `components.securitySchemes`, normalised to snake_case.
        pub fn builder() -> AuthConfigBuilder {
            <AuthConfigBuilder as ::std::default::Default>::default()
        }
    }
    #[derive(Debug, Clone, Default)]
    pub struct AuthConfigBuilder {
        admin_api_key_auth: ::std::option::Option<AdminApiKeyAuthCredential>,
        api_key_auth: ::std::option::Option<ApiKeyAuthCredential>,
    }
    impl AuthConfigBuilder {
        /// Provides the Bearer token for this scheme.
        pub fn admin_api_key_auth<T>(mut self, token: T) -> Self
        where
            T: ::std::convert::Into<::std::string::String>,
        {
            self.admin_api_key_auth =
                ::std::option::Option::Some(AdminApiKeyAuthCredential::new(token));
            self
        }
        /// Provides the Bearer token for this scheme.
        pub fn api_key_auth<T>(mut self, token: T) -> Self
        where
            T: ::std::convert::Into<::std::string::String>,
        {
            self.api_key_auth = ::std::option::Option::Some(ApiKeyAuthCredential::new(token));
            self
        }
        /// Finalises into an [`AuthConfig`].
        pub fn build(self) -> AuthConfig {
            let Self {
                admin_api_key_auth,
                api_key_auth,
            } = self;
            AuthConfig {
                admin_api_key_auth,
                api_key_auth,
            }
        }
    }
    impl ::toac::AuthSelector for AuthConfig {
        fn apply_for(
            &self,
            req: ::toac::Request,
            requirements: &'static [&'static [&'static str]],
        ) -> ::toac::security::AuthFuture<'_> {
            ::std::boxed::Box::pin(async move {
                if requirements.is_empty() {
                    return ::std::result::Result::Ok(req);
                }
                let mut __chosen: ::std::option::Option<&'static [&'static str]> =
                    ::std::option::Option::None;
                for __alt in requirements {
                    let mut __can_satisfy = true;
                    let mut __matched_any = false;
                    for __scheme in __alt.iter().copied() {
                        if __scheme == "AdminApiKeyAuth" {
                            let ::std::option::Option::Some(_) = &self.admin_api_key_auth else {
                                __can_satisfy = false;
                                break;
                            };
                            __matched_any = true;
                            continue;
                        }
                        if __scheme == "ApiKeyAuth" {
                            let ::std::option::Option::Some(_) = &self.api_key_auth else {
                                __can_satisfy = false;
                                break;
                            };
                            __matched_any = true;
                            continue;
                        }
                        let _ = __matched_any;
                        __can_satisfy = false;
                        break;
                    }
                    if __can_satisfy && __matched_any {
                        __chosen = ::std::option::Option::Some(__alt);
                        break;
                    }
                }
                let ::std::option::Option::Some(__alt) = __chosen else {
                    return ::std::result::Result::Err(::std::convert::Into::into(::std::format!(
                        "no configured credentials satisfy {:?}",
                        requirements,
                    )));
                };
                let mut __req = req;
                for __scheme in __alt.iter().copied() {
                    if __scheme == "AdminApiKeyAuth" {
                        let ::std::option::Option::Some(__cred) = &self.admin_api_key_auth else {
                            continue;
                        };
                        __req = ::toac::SecurityCredential::apply(__cred, __req).await?;
                        continue;
                    }
                    if __scheme == "ApiKeyAuth" {
                        let ::std::option::Option::Some(__cred) = &self.api_key_auth else {
                            continue;
                        };
                        __req = ::toac::SecurityCredential::apply(__cred, __req).await?;
                        continue;
                    }
                }
                ::std::result::Result::Ok(__req)
            })
        }
    }
}
