Ë
    F·j}} ã                  óì  — d dl mZ d dlZd dlmZmZmZmZmZ d dl	m
Z
mZ d dlZd dlZddlmZ ddlmZmZmZmZmZ ddlmZmZmZ dd	lmZ dd
lmZmZ ddlm Z m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m&Z& ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddgZ= G d„ de«      Z> G d„ de«      Z? G d„ d«      Z@ G d„ d «      ZA G d!„ d"«      ZB G d#„ d$«      ZCd&d%„ZDy)'é    )ÚannotationsN)ÚDictÚListÚUnionÚIterableÚOptional)ÚLiteralÚoverloadé   )Ú_legacy_response)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Úrequired_argsÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚStreamÚAsyncStream)ÚChatCompletionAudioParamÚcompletion_create_params)Úmake_request_options)Ú	ChatModel)ÚChatCompletion)ÚChatCompletionChunk)ÚChatCompletionModality)ÚChatCompletionToolParam)r   )ÚChatCompletionMessageParam)Ú ChatCompletionStreamOptionsParam)Ú$ChatCompletionPredictionContentParam)Ú#ChatCompletionToolChoiceOptionParamÚCompletionsÚAsyncCompletionsc            !      óª  — e Zd Zedd„«       Zedd„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„«       Z e	ddgg d¢«      eeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zy)r(   c                ó   — t        | «      S ©a  
        This property can be used as a prefix for any HTTP method call to return the
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )ÚCompletionsWithRawResponse©Úselfs    úo/var/www/html/ai-video-generator/backend/venv/lib/python3.12/site-packages/openai/resources/chat/completions.pyÚwith_raw_responsezCompletions.with_raw_response+   s   € ô *¨$Ó/Ð/ó    c                ó   — t        | «      S ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )Ú CompletionsWithStreamingResponser.   s    r0   Úwith_streaming_responsez#Completions.with_streaming_response5   s   € ô 0°Ó5Ð5r2   N©ÚaudioÚfrequency_penaltyÚfunction_callÚ	functionsÚ
logit_biasÚlogprobsÚmax_completion_tokensÚ
max_tokensÚmetadataÚ
modalitiesÚnÚparallel_tool_callsÚ
predictionÚpresence_penaltyÚresponse_formatÚseedÚservice_tierÚstopÚstoreÚstreamÚstream_optionsÚtemperatureÚtool_choiceÚtoolsÚtop_logprobsÚtop_pÚuserÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚmessagesÚmodelc       !         ó   — y©a-  Creates a model response for the given chat conversation.

        Learn more in the
        [text generation](https://platform.openai.com/docs/guides/text-generation),
        [vision](https://platform.openai.com/docs/guides/vision), and
        [audio](https://platform.openai.com/docs/guides/audio) guides.

        Args:
          messages: A list of messages comprising the conversation so far. Depending on the
              [model](https://platform.openai.com/docs/models) you use, different message
              types (modalities) are supported, like
              [text](https://platform.openai.com/docs/guides/text-generation),
              [images](https://platform.openai.com/docs/guides/vision), and
              [audio](https://platform.openai.com/docs/guides/audio).

          model: ID of the model to use. See the
              [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
              table for details on which models work with the Chat API.

          audio: Parameters for audio output. Required when audio output is requested with
              `modalities: ["audio"]`.
              [Learn more](https://platform.openai.com/docs/guides/audio).

          frequency_penalty: 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.

              [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)

          function_call: 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.

          functions: Deprecated in favor of `tools`.

              A list of functions the model may generate JSON inputs for.

          logit_bias: 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.

          logprobs: 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`.

          max_completion_tokens: An upper bound for the number of tokens that can be generated for a completion,
              including visible output tokens and
              [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).

          max_tokens: 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
              [o1 series models](https://platform.openai.com/docs/guides/reasoning).

          metadata: Developer-defined tags and values used for filtering completions in the
              [dashboard](https://platform.openai.com/chat-completions).

          modalities: Output types that you would like the model to generate for this request. Most
              models are capable of generating text, which is the default:

              `["text"]`

              The `gpt-4o-audio-preview` model can also be used to
              [generate audio](https://platform.openai.com/docs/guides/audio). To request that
              this model generate both text and audio responses, you can use:

              `["text", "audio"]`

          n: 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.

          parallel_tool_calls: Whether to enable
              [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
              during tool use.

          prediction: Static predicted output content, such as the content of a text file that is
              being regenerated.

          presence_penalty: 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.

              [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)

          response_format: An object specifying the format that the model must output. Compatible with
              [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
              [GPT-4o mini](https://platform.openai.com/docs/models#gpt-4o-mini),
              [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4) and
              all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.

              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](https://platform.openai.com/docs/guides/structured-outputs).

              Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
              message the model generates is valid JSON.

              **Important:** when using JSON mode, you **must** also instruct the model to
              produce JSON yourself via a system or user message. Without this, the model may
              generate an unending stream of whitespace until the generation reaches the token
              limit, resulting in a long-running and seemingly "stuck" request. Also note that
              the message content may be partially cut off if `finish_reason="length"`, which
              indicates the generation exceeded `max_tokens` or the conversation exceeded the
              max context length.

          seed: 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.

          service_tier: Specifies the latency tier to use for processing the request. This parameter is
              relevant for customers subscribed to the scale tier service:

              - If set to 'auto', and the Project is Scale tier enabled, the system will
                utilize scale tier credits until they are exhausted.
              - If set to 'auto', and the Project is not Scale tier enabled, the request will
                be processed using the default service tier with a lower uptime SLA and no
                latency guarentee.
              - If set to 'default', the request will be processed using the default service
                tier with a lower uptime SLA and no latency guarentee.
              - When not set, the default behavior is 'auto'.

              When this parameter is set, the response body will include the `service_tier`
              utilized.

          stop: Up to 4 sequences where the API will stop generating further tokens.

          store: Whether or not to store the output of this chat completion request for use in
              our [model distillation](https://platform.openai.com/docs/guides/distillation)
              or [evals](https://platform.openai.com/docs/guides/evals) products.

          stream: If set, partial message deltas will be sent, like in ChatGPT. Tokens will be
              sent as data-only
              [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
              as they become available, with the stream terminated by a `data: [DONE]`
              message.
              [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).

          stream_options: Options for streaming response. Only set this when you set `stream: true`.

          temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
              make the output more random, while lower values like 0.2 will make it more
              focused and deterministic.

              We generally recommend altering this or `top_p` but not both.

          tool_choice: 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.

          tools: A list of tools the model may call. Currently, only functions are supported as a
              tool. Use this to provide a list of functions the model may generate JSON inputs
              for. A max of 128 functions are supported.

          top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
              return at each token position, each with an associated log probability.
              `logprobs` must be set to `true` if this parameter is used.

          top_p: An alternative to sampling with temperature, called nucleus sampling, where the
              model considers the results of the tokens with top_p probability mass. So 0.1
              means only the tokens comprising the top 10% probability mass are considered.

              We generally recommend altering this or `temperature` but not both.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        N© ©"r/   rW   rX   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   s"                                     r0   ÚcreatezCompletions.create>   ó   € ð` 	r2   ©r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   c       !         ó   — y©a-  Creates a model response for the given chat conversation.

        Learn more in the
        [text generation](https://platform.openai.com/docs/guides/text-generation),
        [vision](https://platform.openai.com/docs/guides/vision), and
        [audio](https://platform.openai.com/docs/guides/audio) guides.

        Args:
          messages: A list of messages comprising the conversation so far. Depending on the
              [model](https://platform.openai.com/docs/models) you use, different message
              types (modalities) are supported, like
              [text](https://platform.openai.com/docs/guides/text-generation),
              [images](https://platform.openai.com/docs/guides/vision), and
              [audio](https://platform.openai.com/docs/guides/audio).

          model: ID of the model to use. See the
              [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility)
              table for details on which models work with the Chat API.

          stream: If set, partial message deltas will be sent, like in ChatGPT. Tokens will be
              sent as data-only
              [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
              as they become available, with the stream terminated by a `data: [DONE]`
              message.
              [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).

          audio: Parameters for audio output. Required when audio output is requested with
              `modalities: ["audio"]`.
              [Learn more](https://platform.openai.com/docs/guides/audio).

          frequency_penalty: 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.

              [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)

          function_call: 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.

          functions: Deprecated in favor of `tools`.

              A list of functions the model may generate JSON inputs for.

          logit_bias: 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.

          logprobs: 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`.

          max_completion_tokens: An upper bound for the number of tokens that can be generated for a completion,
              including visible output tokens and
              [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).

          max_tokens: 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
              [o1 series models](https://platform.openai.com/docs/guides/reasoning).

          metadata: Developer-defined tags and values used for filtering completions in the
              [dashboard](https://platform.openai.com/chat-completions).

          modalities: Output types that you would like the model to generate for this request. Most
              models are capable of generating text, which is the default:

              `["text"]`

              The `gpt-4o-audio-preview` model can also be used to
              [generate audio](https://platform.openai.com/docs/guides/audio). To request that
              this model generate both text and audio responses, you can use:

              `["text", "audio"]`

          n: 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.

          parallel_tool_calls: Whether to enable
              [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
              during tool use.

          prediction: Static predicted output content, such as the content of a text file that is
              being regenerated.

          presence_penalty: 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.

              [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)

          response_format: An object specifying the format that the model must output. Compatible with
              [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
              [GPT-4o mini](https://platform.openai.com/docs/models#gpt-4o-mini),
              [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4) and
              all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.

              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](https://platform.openai.com/docs/guides/structured-outputs).

              Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
              message the model generates is valid JSON.

              **Important:** when using JSON mode, you **must** also instruct the model to
              produce JSON yourself via a system or user message. Without this, the model may
              generate an unending stream of whitespace until the generation reaches the token
              limit, resulting in a long-running and seemingly "stuck" request. Also note that
              the message content may be partially cut off if `finish_reason="length"`, which
              indicates the generation exceeded `max_tokens` or the conversation exceeded the
              max context length.

          seed: 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.

          service_tier: Specifies the latency tier to use for processing the request. This parameter is
              relevant for customers subscribed to the scale tier service:

              - If set to 'auto', and the Project is Scale tier enabled, the system will
                utilize scale tier credits until they are exhausted.
              - If set to 'auto', and the Project is not Scale tier enabled, the request will
                be processed using the default service tier with a lower uptime SLA and no
                latency guarentee.
              - If set to 'default', the request will be processed using the default service
                tier with a lower uptime SLA and no latency guarentee.
              - When not set, the default behavior is 'auto'.

              When this parameter is set, the response body will include the `service_tier`
              utilized.

          stop: Up to 4 sequences where the API will stop generating further tokens.

          store: Whether or not to store the output of this chat completion request for use in
              our [model distillation](https://platform.openai.com/docs/guides/distillation)
              or [evals](https://platform.openai.com/docs/guides/evals) products.

          stream_options: Options for streaming response. Only set this when you set `stream: true`.

          temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
              make the output more random, while lower values like 0.2 will make it more
              focused and deterministic.

              We generally recommend altering this or `top_p` but not both.

          tool_choice: 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.

          tools: A list of tools the model may call. Currently, only functions are supported as a
              tool. Use this to provide a list of functions the model may generate JSON inputs
              for. A max of 128 functions are supported.

          top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to
              return at each token position, each with an associated log probability.
              `logprobs` must be set to `true` if this parameter is used.

          top_p: An alternative to sampling with temperature, called nucleus sampling, where the
              model considers the results of the tokens with top_p probability mass. So 0.1
              means only the tokens comprising the top 10% probability mass are considered.

              We generally recommend altering this or `temperature` but not both.

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        Nr[   ©"r/   rW   rX   rK   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   s"                                     r0   r]   zCompletions.create0  r^   r2   c       !         ó   — yra   r[   rb   s"                                     r0   r]   zCompletions.create"  r^   r2   ©rW   rX   rK   c       !        ó:  — t        |«       | j                  dt        i d|“d|“d|“d|“d|“d|“d|“d	|“d
|	“d|
“d|“d|“d|“d|“d|“d|“d|“||||||||||||dœ¥t        j                  «      t        ||| |!¬«      t        |xs dt        t           ¬«      S ©Nz/chat/completionsrW   rX   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   )rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   )rS   rT   rU   rV   F)ÚbodyÚoptionsÚcast_torK   Ú
stream_cls)	Úvalidate_response_formatÚ_postr   r   ÚCompletionCreateParamsr   r    r   r!   r\   s"                                     r0   r]   zCompletions.create  sb  € ôP 	! Ô1Ø�z‰zØÜ ðØ ðà˜Uðð ˜Uðð (Ð):ð	ð
 $ ]ðð   ðð ! *ðð  ðð ,Ð-Bðð ! *ðð  ðð ! *ðð ˜ðð *Ð+>ðð ! *ðð  'Ð(8ð!ð" & ð#ð$ !Ø$0Ø Ø"Ø$Ø&4Ø#.Ø#.Ø"Ø$0Ø"Ø ò;ô> )×?Ñ?óA!ôD )Ø+¸ÐQ[Ðelôô #Ø’?˜UÜÔ1Ñ2ðS ó *
ð *	
r2   )Úreturnr-   )rn   r5   ©DrW   ú$Iterable[ChatCompletionMessageParam]rX   úUnion[str, ChatModel]r8   ú-Optional[ChatCompletionAudioParam] | NotGivenr9   úOptional[float] | NotGivenr:   ú0completion_create_params.FunctionCall | NotGivenr;   ú6Iterable[completion_create_params.Function] | NotGivenr<   ú#Optional[Dict[str, int]] | NotGivenr=   úOptional[bool] | NotGivenr>   úOptional[int] | NotGivenr?   rx   r@   ú#Optional[Dict[str, str]] | NotGivenrA   ú1Optional[List[ChatCompletionModality]] | NotGivenrB   rx   rC   úbool | NotGivenrD   ú9Optional[ChatCompletionPredictionContentParam] | NotGivenrE   rs   rF   ú2completion_create_params.ResponseFormat | NotGivenrG   rx   rH   ú/Optional[Literal['auto', 'default']] | NotGivenrI   ú*Union[Optional[str], List[str]] | NotGivenrJ   rw   rK   z#Optional[Literal[False]] | NotGivenrL   ú5Optional[ChatCompletionStreamOptionsParam] | NotGivenrM   rs   rN   ú.ChatCompletionToolChoiceOptionParam | NotGivenrO   ú,Iterable[ChatCompletionToolParam] | NotGivenrP   rx   rQ   rs   rR   ústr | NotGivenrS   úHeaders | NonerT   úQuery | NonerU   úBody | NonerV   ú'float | httpx.Timeout | None | NotGivenrn   r    )DrW   rp   rX   rq   rK   úLiteral[True]r8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   zStream[ChatCompletionChunk])DrW   rp   rX   rq   rK   Úboolr8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   ú,ChatCompletion | Stream[ChatCompletionChunk])DrW   rp   rX   rq   r8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rK   ú3Optional[Literal[False]] | Literal[True] | NotGivenrL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   rŠ   ©
Ú__name__Ú
__module__Ú__qualname__r   r1   r6   r
   r   r]   r   r[   r2   r0   r(   r(   *   s<  „ Øò0ó ð0ð ò6ó ð6ð ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4Ø6?ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð $ðoð  -ð!oð" Nð#oð$ 5ð%oð& Lð'oð( 'ð)oð* Fð+oð, 9ð-oð. )ð/oð0 4ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
òMoó ðoðb ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 ðoð =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð  $ð!oð" -ð#oð$ Nð%oð& 5ð'oð( Lð)oð* 'ð+oð, Fð-oð. 9ð/oð0 )ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
%òMoó ðoðb ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 ðoð =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð  $ð!oð" -ð#oð$ Nð%oð& 5ð'oð( Lð)oð* 'ð+oð, Fð-oð. 9ð/oð0 )ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
6òMoó ðoñb �J Ð(Ò*IÓJð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØFOØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKR
ð 7ðR
ð %ð	R
ð
 =ðR
ð 6ðR
ð HðR
ð JðR
ð 8ðR
ð ,ðR
ð  8ðR
ð -ðR
ð 6ðR
ð FðR
ð $ðR
ð  -ð!R
ð" Nð#R
ð$ 5ð%R
ð& Lð'R
ð( 'ð)R
ð* Fð+R
ð, 9ð-R
ð. )ð/R
ð0 Dð1R
ð2 Nð3R
ð4 0ð5R
ð6 Dð7R
ð8 <ð9R
ð: /ð;R
ð< *ð=R
ð> ð?R
ðD &ðER
ðF "ðGR
ðH  ðIR
ðJ 9ðKR
ðL 
6òMR
ó KñR
r2   c            !      óª  — e Zd Zedd„«       Zedd„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	„«       Zeeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„«       Z e	ddgg d¢«      eeeeeeeeeeeeeeeeeeeeeeeeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Zy)r)   c                ó   — t        | «      S r,   )ÚAsyncCompletionsWithRawResponser.   s    r0   r1   z"AsyncCompletions.with_raw_responsek  s   € ô /¨tÓ4Ð4r2   c                ó   — t        | «      S r4   )Ú%AsyncCompletionsWithStreamingResponser.   s    r0   r6   z(AsyncCompletions.with_streaming_responseu  s   € ô 5°TÓ:Ð:r2   Nr7   rW   rX   c       !      ƒ  ó   K  — y­wrZ   r[   r\   s"                                     r0   r]   zAsyncCompletions.create~  ó   è ø€ ð` 	ùó   ‚r_   c       !      ƒ  ó   K  — y­wra   r[   rb   s"                                     r0   r]   zAsyncCompletions.createp  r–   r—   c       !      ƒ  ó   K  — y­wra   r[   rb   s"                                     r0   r]   zAsyncCompletions.createb  r–   r—   rd   c       !      ƒ  ój  K  — t        |«       | j                  dt        i d|“d|“d|“d|“d|“d|“d|“d	|“d
|	“d|
“d|“d|“d|“d|“d|“d|“d|“||||||||||||dœ¥t        j                  «      ƒ d {  –—† t        ||| |!¬«      t        |xs dt        t           ¬«      ƒ d {  –—† S 7 Œ57 Œ­wrf   )	rk   rl   r   r   rm   r   r    r   r!   r\   s"                                     r0   r]   zAsyncCompletions.createT  s{  è ø€ ôP 	! Ô1Ø—Z‘ZØÜ,ðØ ðà˜Uðð ˜Uðð (Ð):ð	ð
 $ ]ðð   ðð ! *ðð  ðð ,Ð-Bðð ! *ðð  ðð ! *ðð ˜ðð *Ð+>ðð ! *ðð  'Ð(8ð!ð" & ð#ð$ !Ø$0Ø Ø"Ø$Ø&4Ø#.Ø#.Ø"Ø$0Ø"Ø ò;ô> )×?Ñ?óA!÷ !ôD )Ø+¸ÐQ[Ðelôô #Ø’?˜UÜ"Ô#6Ñ7ðS  ó *
÷ *
ð *	
ð!øð*
ús$   ‚A7B3Á9B/
Á:0B3Â*B1Â+B3Â1B3)rn   r’   )rn   r”   ro   )DrW   rp   rX   rq   rK   rˆ   r8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   z AsyncStream[ChatCompletionChunk])DrW   rp   rX   rq   rK   r‰   r8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   ú1ChatCompletion | AsyncStream[ChatCompletionChunk])DrW   rp   rX   rq   r8   rr   r9   rs   r:   rt   r;   ru   r<   rv   r=   rw   r>   rx   r?   rx   r@   ry   rA   rz   rB   rx   rC   r{   rD   r|   rE   rs   rF   r}   rG   rx   rH   r~   rI   r   rJ   rw   rK   r‹   rL   r€   rM   rs   rN   r�   rO   r‚   rP   rx   rQ   rs   rR   rƒ   rS   r„   rT   r…   rU   r†   rV   r‡   rn   r›   rŒ   r[   r2   r0   r)   r)   j  s<  „ Øò5ó ð5ð ò;ó ð;ð ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4Ø6?ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð $ðoð  -ð!oð" Nð#oð$ 5ð%oð& Lð'oð( 'ð)oð* Fð+oð, 9ð-oð. )ð/oð0 4ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
òMoó ðoðb ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 ðoð =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð  $ð!oð" -ð#oð$ Nð%oð& 5ð'oð( Lð)oð* 'ð+oð, Fð-oð. 9ð/oð0 )ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
*òMoó ðoðb ð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKoð 7ðoð %ð	oð
 ðoð =ðoð 6ðoð Hðoð Jðoð 8ðoð ,ðoð  8ðoð -ðoð 6ðoð Fðoð  $ð!oð" -ð#oð$ Nð%oð& 5ð'oð( Lð)oð* 'ð+oð, Fð-oð. 9ð/oð0 )ð1oð2 Nð3oð4 0ð5oð6 Dð7oð8 <ð9oð: /ð;oð< *ð=oð> ð?oðD &ðEoðF "ðGoðH  ðIoðJ 9ðKoðL 
;òMoó ðoñb �J Ð(Ò*IÓJð @IØ8AØJSØLUØ:CØ.7Ø:CØ/8Ø8AØHQØ&/Ø/8ØPYØ7@ØNWØ)2ØHQØ;DØ+4ØFOØPYØ2;ØFOØ>GØ1:Ø,5Ø(ð )-Ø$(Ø"&Ø;DñKR
ð 7ðR
ð %ð	R
ð
 =ðR
ð 6ðR
ð HðR
ð JðR
ð 8ðR
ð ,ðR
ð  8ðR
ð -ðR
ð 6ðR
ð FðR
ð $ðR
ð  -ð!R
ð" Nð#R
ð$ 5ð%R
ð& Lð'R
ð( 'ð)R
ð* Fð+R
ð, 9ð-R
ð. )ð/R
ð0 Dð1R
ð2 Nð3R
ð4 0ð5R
ð6 Dð7R
ð8 <ð9R
ð: /ð;R
ð< *ð=R
ð> ð?R
ðD &ðER
ðF "ðGR
ðH  ðIR
ðJ 9ðKR
ðL 
;òMR
ó KñR
r2   c                  ó   — e Zd Zdd„Zy)r-   c                óZ   — || _         t        j                  |j                  «      | _        y ©N)Ú_completionsr   Úto_raw_response_wrapperr]   ©r/   Úcompletionss     r0   Ú__init__z#CompletionsWithRawResponse.__init__«  s%   € Ø'ˆÔä&×>Ñ>Ø×Ñó
ˆ�r2   N©r¢   r(   rn   ÚNone©r�   rŽ   r�   r£   r[   r2   r0   r-   r-   ª  ó   „ ô
r2   r-   c                  ó   — e Zd Zdd„Zy)r’   c                óZ   — || _         t        j                  |j                  «      | _        y rž   )rŸ   r   Úasync_to_raw_response_wrapperr]   r¡   s     r0   r£   z(AsyncCompletionsWithRawResponse.__init__´  s%   € Ø'ˆÔä&×DÑDØ×Ñó
ˆ�r2   N©r¢   r)   rn   r¥   r¦   r[   r2   r0   r’   r’   ³  r§   r2   r’   c                  ó   — e Zd Zdd„Zy)r5   c                óF   — || _         t        |j                  «      | _        y rž   )rŸ   r   r]   r¡   s     r0   r£   z)CompletionsWithStreamingResponse.__init__½  s   € Ø'ˆÔä2Ø×Ñó
ˆ�r2   Nr¤   r¦   r[   r2   r0   r5   r5   ¼  r§   r2   r5   c                  ó   — e Zd Zdd„Zy)r”   c                óF   — || _         t        |j                  «      | _        y rž   )rŸ   r   r]   r¡   s     r0   r£   z.AsyncCompletionsWithStreamingResponse.__init__Æ  s   € Ø'ˆÔä8Ø×Ñó
ˆ�r2   Nr«   r¦   r[   r2   r0   r”   r”   Å  r§   r2   r”   c                óz   — t        j                  | «      r&t        | t        j                  «      rt        d«      ‚y y )NzzYou tried to pass a `BaseModel` class to `chat.completions.create()`; You must use `beta.chat.completions.parse()` instead)ÚinspectÚisclassÚ
issubclassÚpydanticÚ	BaseModelÚ	TypeError)rF   s    r0   rk   rk   Î  s9   € Ü‡��Ô'¬J°Ì×HZÑHZÔ,[Üð Ió
ð 	
ð -\Ð'r2   )rF   Úobjectrn   r¥   )EÚ
__future__r   r±   Útypingr   r   r   r   r   Útyping_extensionsr	   r
   Úhttpxr´   Ú r   Ú_typesr   r   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
_streamingr   r   Ú
types.chatr   r   Ú_base_clientr   Útypes.chat_modelr   Útypes.chat.chat_completionr    Ú types.chat.chat_completion_chunkr!   Ú#types.chat.chat_completion_modalityr"   Ú%types.chat.chat_completion_tool_paramr#   Ú&types.chat.chat_completion_audio_paramÚ(types.chat.chat_completion_message_paramr$   Ú/types.chat.chat_completion_stream_options_paramr%   Ú3types.chat.chat_completion_prediction_content_paramr&   Ú3types.chat.chat_completion_tool_choice_option_paramr'   Ú__all__r(   r)   r-   r’   r5   r”   rk   r[   r2   r0   ú<module>rÐ      s¼   ðõ #ã ß 8Õ 8ß /ã Û å  ß ?Õ ?÷ñ õ
 'ß :ß Yß -÷õ 1Ý )Ý 8Ý CÝ IÝ LÝ NÝ RÝ _Ý gÝ fàÐ,Ð
-€ô}
�/ô }
ô@}
Ð'ô }
÷@
ñ 
÷
ñ 
÷
ñ 
÷
ñ 
ô
r2   