
    hks                   ^   S SK Jr  S SKJrJrJrJrJrJrJ	r	  S SK
Jr  S SKJrJr  S SKrSSKJr  SSKJrJrJrJrJrJr  SS	KJrJrJrJr  SS
KJr  SSK J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'J(r(J)r)J*r*J+r+J,r,  SSK-J.r.J/r/  SSK0J1r1J2r2  SSK3J4r4  SSK5J6r6J7r7  SSK8J9r9J:r:J;r<  SSK=J>r>  SSK?J@r@  SSKAJBrBJCrC  SSKDJErE  SSKFJGrG  SSKHJIrI  SSKJJKrKJLrL  SSKMJNrN  SSKOJPrP  SSKQJRrR  SSKSJTrT  SSKUJVrV  S S!/rW " S" S \!5      rX " S# S!\"5      rY " S$ S%5      rZ " S& S'5      r[ " S( S)5      r\ " S* S+5      r]S-S, jr^g).    )annotations)AnyListTypeUnionIterableOptionalcast)partial)LiteraloverloadN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNoneTypeNotGiven)is_givenrequired_argsmaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper   )
InputItemsAsyncInputItemsInputItemsWithRawResponseAsyncInputItemsWithRawResponseInputItemsWithStreamingResponse$AsyncInputItemsWithStreamingResponse)StreamAsyncStream)PydanticFunctionToolResponsesPydanticFunctionTool)make_request_options)response_create_paramsresponse_retrieve_params)TextFormatTparse_responsetype_to_text_format_param)	ChatModel)Response)	ToolParamParseableToolParam)Metadata)	Reasoning)ParsedResponse)ResponseStreamManagerAsyncResponseStreamManager)ResponseIncludable)ResponsesModel)ResponseInputParam)ResponseStreamEvent)ResponseTextConfigParam	ResponsesAsyncResponsesc                  v   \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               SS	 jj5       r
\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S
.                                               SS jj5       r
\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S
.                                               SS jj5       r
\" SS// SQ5      \	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               SS jj5       r
\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                             SS jjr\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               S S jjr\	SSS\	S.             S!S jjrSSS\	S.           S"S jjrSrg)#r>   7   c                ,    [        U R                  5      $ N)r    _clientselfs    V/var/www/html/env/lib/python3.13/site-packages/openai/resources/responses/responses.pyinput_itemsResponses.input_items8   s    $,,''    c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return
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
)ResponsesWithRawResponserE   s    rG   with_raw_responseResponses.with_raw_response<   s     (--rJ   c                    [        U 5      $ 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
)ResponsesWithStreamingResponserE   s    rG   with_streaming_response!Responses.with_streaming_responseF   s     .d33rJ   Nincludeinstructionsmax_output_tokensmetadataparallel_tool_callsprevious_response_id	reasoningservice_tierstorestreamtemperaturetexttool_choicetoolstop_p
truncationuserextra_headersextra_query
extra_bodytimeoutinputmodelc                   ga  Creates a model response.

Provide
[text](https://platform.openai.com/docs/guides/text) or
[image](https://platform.openai.com/docs/guides/images) inputs to generate
[text](https://platform.openai.com/docs/guides/text) or
[JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have
the model call your own
[custom code](https://platform.openai.com/docs/guides/function-calling) or use
built-in [tools](https://platform.openai.com/docs/guides/tools) like
[web search](https://platform.openai.com/docs/guides/tools-web-search) or
[file search](https://platform.openai.com/docs/guides/tools-file-search) to use
your own data as input for the model's response.

Args:
  input: Text, image, or file inputs to the model, used to generate a response.

      Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Image inputs](https://platform.openai.com/docs/guides/images)
      - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
      - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
      - [Function calling](https://platform.openai.com/docs/guides/function-calling)

  model: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
      wide range of models with different capabilities, performance characteristics,
      and price points. Refer to the
      [model guide](https://platform.openai.com/docs/models) to browse and compare
      available models.

  include: Specify additional output data to include in the model response. Currently
      supported values are:

      - `file_search_call.results`: Include the search results of the file search tool
        call.
      - `message.input_image.image_url`: Include image urls from the input message.
      - `computer_call_output.output.image_url`: Include image urls from the computer
        call output.

  instructions: Inserts a system (or developer) message as the first item in the model's
      context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple to
      swap out system (or developer) messages in new responses.

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

  metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
      for storing additional information about the object in a structured format, and
      querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings with
      a maximum length of 512 characters.

  parallel_tool_calls: Whether to allow the model to run tool calls in parallel.

  previous_response_id: The unique ID of the previous response to the model. Use this to create
      multi-turn conversations. Learn more about
      [conversation state](https://platform.openai.com/docs/guides/conversation-state).

  reasoning: **o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

  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.
      - If set to 'flex', the request will be processed with the Flex Processing
        service tier.
        [Learn more](https://platform.openai.com/docs/guides/flex-processing).
      - When not set, the default behavior is 'auto'.

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

  store: Whether to store the generated model response for later retrieval via API.

  stream: 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](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

  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.

  text: Configuration options for a text response from the model. Can be plain text or
      structured JSON data. Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)

  tool_choice: How the model should select which tool (or tools) to use when generating a
      response. See the `tools` parameter to see how to specify which tools the model
      can call.

  tools: An array of tools the model may call while generating a response. You can
      specify which tool to use by setting the `tool_choice` parameter.

      The two categories of tools you can provide the model are:

      - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
        capabilities, like
        [web search](https://platform.openai.com/docs/guides/tools-web-search) or
        [file search](https://platform.openai.com/docs/guides/tools-file-search).
        Learn more about
        [built-in tools](https://platform.openai.com/docs/guides/tools).
      - **Function calls (custom tools)**: Functions that are defined by you, enabling
        the model to call your own code. Learn more about
        [function calling](https://platform.openai.com/docs/guides/function-calling).

  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.

  truncation: The truncation strategy to use for the model response.

      - `auto`: If the context of this response and previous ones exceeds the model's
        context window size, the model will truncate the response to fit the context
        window by dropping input items in the middle of the conversation.
      - `disabled` (default): If a model response will exceed the context window size
        for a model, the request will fail with a 400 error.

  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 rF   rk   rl   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   s                           rG   createResponses.createO       l 	rJ   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   c                   ga  Creates a model response.

Provide
[text](https://platform.openai.com/docs/guides/text) or
[image](https://platform.openai.com/docs/guides/images) inputs to generate
[text](https://platform.openai.com/docs/guides/text) or
[JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have
the model call your own
[custom code](https://platform.openai.com/docs/guides/function-calling) or use
built-in [tools](https://platform.openai.com/docs/guides/tools) like
[web search](https://platform.openai.com/docs/guides/tools-web-search) or
[file search](https://platform.openai.com/docs/guides/tools-file-search) to use
your own data as input for the model's response.

Args:
  input: Text, image, or file inputs to the model, used to generate a response.

      Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Image inputs](https://platform.openai.com/docs/guides/images)
      - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
      - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
      - [Function calling](https://platform.openai.com/docs/guides/function-calling)

  model: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
      wide range of models with different capabilities, performance characteristics,
      and price points. Refer to the
      [model guide](https://platform.openai.com/docs/models) to browse and compare
      available models.

  stream: 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](https://platform.openai.com/docs/api-reference/responses-streaming)
      for more information.

  include: Specify additional output data to include in the model response. Currently
      supported values are:

      - `file_search_call.results`: Include the search results of the file search tool
        call.
      - `message.input_image.image_url`: Include image urls from the input message.
      - `computer_call_output.output.image_url`: Include image urls from the computer
        call output.

  instructions: Inserts a system (or developer) message as the first item in the model's
      context.

      When using along with `previous_response_id`, the instructions from a previous
      response will not be carried over to the next response. This makes it simple to
      swap out system (or developer) messages in new responses.

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

  metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
      for storing additional information about the object in a structured format, and
      querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings with
      a maximum length of 512 characters.

  parallel_tool_calls: Whether to allow the model to run tool calls in parallel.

  previous_response_id: The unique ID of the previous response to the model. Use this to create
      multi-turn conversations. Learn more about
      [conversation state](https://platform.openai.com/docs/guides/conversation-state).

  reasoning: **o-series models only**

      Configuration options for
      [reasoning models](https://platform.openai.com/docs/guides/reasoning).

  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.
      - If set to 'flex', the request will be processed with the Flex Processing
        service tier.
        [Learn more](https://platform.openai.com/docs/guides/flex-processing).
      - When not set, the default behavior is 'auto'.

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

  store: Whether to store the generated model response for later retrieval via API.

  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.

  text: Configuration options for a text response from the model. Can be plain text or
      structured JSON data. Learn more:

      - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
      - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)

  tool_choice: How the model should select which tool (or tools) to use when generating a
      response. See the `tools` parameter to see how to specify which tools the model
      can call.

  tools: An array of tools the model may call while generating a response. You can
      specify which tool to use by setting the `tool_choice` parameter.

      The two categories of tools you can provide the model are:

      - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
        capabilities, like
        [web search](https://platform.openai.com/docs/guides/tools-web-search) or
        [file search](https://platform.openai.com/docs/guides/tools-file-search).
        Learn more about
        [built-in tools](https://platform.openai.com/docs/guides/tools).
      - **Function calls (custom tools)**: Functions that are defined by you, enabling
        the model to call your own code. Learn more about
        [function calling](https://platform.openai.com/docs/guides/function-calling).

  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.

  truncation: The truncation strategy to use for the model response.

      - `auto`: If the context of this response and previous ones exceeds the model's
        context window size, the model will truncate the response to fit the context
        window by dropping input items in the middle of the conversation.
      - `disabled` (default): If a model response will exceed the context window size
        for a model, the request will fail with a 400 error.

  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
Nro   rF   rk   rl   r_   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   s                           rG   rq   rr     rs   rJ   c                   grv   ro   rw   s                           rG   rq   rr     rs   rJ   rk   rl   r_   c               <   U R                  S[        0 SU_SU_SU_SU_SU_SU_SU_S	U_S
U	_SU
_SU_SU_SU_SU_SU_SU_SU_UUS.EU(       a  [        R                  O[        R                  5      [        UUUUS9[        U=(       d    S[        [           S9$ N
/responsesrk   rl   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   )re   rf   rg   rh   ri   rj   F)bodyoptionscast_tor_   
stream_cls)	_postr   r+   ResponseCreateParamsStreaming ResponseCreateParamsNonStreamingr*   r1   r&   r<   rp   s                           rG   rq   rr   w  sF   < zz UU w #L	
 ():  *+> +,@   #L U f "; D ";  U!" U#$ #- ',  'DD+LL14 )+Q[el ?U12C  "
 "	
rJ   text_formatrc   rV   rW   rX   rY   rZ   r[   r\   r^   r`   ra   rb   rd   re   rf   rg   rh   ri   rj   c               J   [        U5      (       a(  U(       d  0 nSU;   a  [        S5      e[        U5      US'   [        U5      n[	        U R
                  40 SU_SU_SU_SU_SU_SU_S	U_S
U	_SU
_SU_SS_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_6n[        UUUS9$ )Nformat1Cannot mix and match text.format with text_formatrk   rl   rc   rV   rW   rX   rY   rZ   r[   r^   r_   Tr`   ra   rb   r\   rd   re   rf   rg   rh   ri   rj   r   input_tools)r   	TypeError_type_to_text_format_param_make_toolsr   rq   r7   rF   rk   rl   r   rc   rV   rW   rX   rY   rZ   r[   r\   r^   r`   ra   rb   rd   re   rf   rg   rh   ri   rj   api_requests                           rG   r_   Responses.stream  sF   8 K  4 STT7DDNE"<CKK=
=
 =
 	=

 =
 &=
 0=
 =
 !4=
 "6=
 =
 =
 $=
 =
 $=
   !=
" #=
$ "%=
& '=
( ()=
* $+=
, "-=
. /=
4 %#
 	
rJ   r   rc   rV   rW   rX   rY   rZ   r[   r\   r^   r_   r`   ra   rb   rd   re   rf   rg   rh   ri   rj   c                 ^^ [        T5      (       a(  U(       d  0 nSU;   a  [        S5      e[        T5      US'   [        T5      mSUU4S jjnU R	                  S[        0 SU_SU_SU_SU_S	U_S
U_SU	_SU
_SU_SU_SU_SU_SU_SU_ST_SU_SU_SU0E[        R                  5      [        UUUUUS9[        [        [        [              [        5      S9$ )Nr   r   c                   > [        TTU S9$ N)r   r   responser.   raw_responser   rc   s    rG   parserResponses.parse.<locals>.parser(      !!'% rJ   r|   rk   rl   rV   rW   rX   rY   rZ   r[   r\   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   post_parserr~   r   r   r   r1   returnParsedResponse[TextFormatT]r   r   r   r   r   r   r+   ResponseCreateParamsr*   r
   r   r6   r-   r1   rF   rk   rl   r   rc   rV   rW   rX   rY   rZ   r[   r\   r^   r_   r`   ra   rb   rd   re   rf   rg   rh   ri   rj   r   s      ``                    rG   parseResponses.parse   s   : K  4 STT7DDNE"	 	 zz UU w #L	
 ():  *+> +,@   U f "; D "; U  U!" !*#$ D%( ';;+. )+'%" n[9:HEE  #
 #	
rJ   rV   rg   rh   ri   rj   c                   U(       d  [        SU< 35      eU R                  SU 3[        UUUU[        SU0[        R
                  5      S9[        S9$ )  
Retrieves a model response with the given ID.

Args:
  include: Additional fields to include in the response. See the `include` parameter for
      Response creation above for more information.

  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
:Expected a non-empty value for `response_id` but received /responses/rV   rg   rh   ri   rj   queryr   r   )
ValueError_getr*   r   r,   ResponseRetrieveParamsr1   rF   response_idrV   rg   rh   ri   rj   s          rG   retrieveResponses.retrieveT  sk    6 YZeYhijjyy+'(+'%%y'&:<T<k<kl   

 
	
rJ   r}   c          
         U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU 3[        X#XES9[        S9$ )'  
Deletes a model response with the given ID.

Args:
  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
r   Accept*/*r   r}   r   r   _deleter*   r   rF   r   rg   rh   ri   rj   s         rG   deleteResponses.delete}  sc    . YZeYhijj!5B]-@bB||+'(+Q[   
 	
rJ   ro   )r   r    )r   rM   )r   rR   0rk   Union[str, ResponseInputParam]rl   r:   rV   -Optional[List[ResponseIncludable]] | NotGivenrW   Optional[str] | NotGivenrX   Optional[int] | NotGivenrY   Optional[Metadata] | NotGivenrZ   Optional[bool] | NotGivenr[   r   r\   Optional[Reasoning] | NotGivenr]   7Optional[Literal['auto', 'default', 'flex']] | NotGivenr^   r   r_   z#Optional[Literal[False]] | NotGivenr`   Optional[float] | NotGivenra   "ResponseTextConfigParam | NotGivenrb   ,response_create_params.ToolChoice | NotGivenrc   Iterable[ToolParam] | NotGivenrd   r   re   0Optional[Literal['auto', 'disabled']] | NotGivenrf   str | NotGivenrg   Headers | Nonerh   Query | Noneri   Body | Nonerj   'float | httpx.Timeout | None | NotGivenr   r1   )0rk   r   rl   r:   r_   Literal[True]rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   zStream[ResponseStreamEvent])0rk   r   rl   r:   r_   boolrV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   &Response | Stream[ResponseStreamEvent])0rk   r   rl   r:   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r_   3Optional[Literal[False]] | Literal[True] | NotGivenr`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   r   ).rk   r   rl   Union[str, ChatModel]r   type[TextFormatT] | NotGivenrc   'Iterable[ParseableToolParam] | NotGivenrV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r^   r   r`   r   ra   r   rb   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   z"ResponseStreamManager[TextFormatT]0rk   r   rl   r   r   r   rc   r   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r^   r   r_   r   r`   r   ra   r   rb   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   r   r   strrV   z#List[ResponseIncludable] | NotGivenrg   r   rh   r   ri   r   rj   r   r   r1   r   r   rg   r   rh   r   ri   r   rj   r   r   None__name__
__module____qualname____firstlineno__r   rH   rN   rS   r   r   rq   r   r_   r   r   r   __static_attributes__ro   rJ   rG   r>   r>   7   s	   ( ( . . 4 4  BK1:6?2;9B9B4=PY+46?2;3<DM09,5GP( )-$("&;D7u .u 	u
 ?u /u 4u 0u 7u 7u 2u Nu )u 4u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
9u un  BK1:6?2;9B9B4=PY+42;3<DM09,5GP( )-$("&;D7u .u 	u
 u ?u /u 4u 0u 7u 7u 2u Nu )u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
%9u un  BK1:6?2;9B9B4=PY+42;3<DM09,5GP( )-$("&;D7u .u 	u
 u ?u /u 4u 0u 7u 7u 2u Nu )u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
09u un GW%'CD BK1:6?2;9B9B4=PY+4FO2;3<DM09,5GP( )-$("&;D7?
 .?
 	?

 ??
 /?
 4?
 0?
 7?
 7?
 2?
 N?
 )?
 D?
 0?
  1!?
" B#?
$ .%?
& *'?
( E)?
* +?
0 &1?
2 "3?
4  5?
6 97?
8 
09?
 E?
L 5>9BAJ1:6?2;9B9B4=+42;3<DM,5GP( )-$("&;D5E
 .E
 %	E

 2E
 7E
 ?E
 /E
 4E
 0E
 7E
 7E
 2E
 )E
 0E
  1!E
" B#E
$ *%E
& E'E
( )E
. &/E
0 "1E
2  3E
4 95E
6 
,7E
X 5>9BAJ1:6?2;9B9B4=+4FO2;3<DM,5GP( )-$("&;D7R
 .R
 %	R

 2R
 7R
 ?R
 /R
 4R
 0R
 7R
 7R
 2R
 )R
 DR
  0!R
" 1#R
$ B%R
& *'R
( E)R
* +R
0 &1R
2 "3R
4  5R
6 97R
8 
%9R
p 8A )-$("&;D'
'
 5	'
 &'
 "'
  '
 9'
 
'
^ )-$("&;D 
 
 & 
 " 
   
 9 
 
 
  
rJ   c                  v   \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               SS	 jj5       r
\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S
.                                               SS jj5       r
\\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S
.                                               SS jj5       r
\" SS// SQ5      \	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               SS jj5       r
\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                             SS jjr\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                               S S jjr\	SSS\	S.             S!S jjrSSS\	S.           S"S jjrSrg)#r?   i  c                ,    [        U R                  5      $ rC   )r!   rD   rE   s    rG   rH   AsyncResponses.input_items  s    t||,,rJ   c                    [        U 5      $ rL   )AsyncResponsesWithRawResponserE   s    rG   rN    AsyncResponses.with_raw_response  s     -T22rJ   c                    [        U 5      $ rQ   )#AsyncResponsesWithStreamingResponserE   s    rG   rS   &AsyncResponses.with_streaming_response  s     3488rJ   NrU   rk   rl   c                  #    g7frn   ro   rp   s                           rG   rq   AsyncResponses.create       l 	   rt   c                  #    g7frv   ro   rw   s                           rG   rq   r   p  r   r   c                  #    g7frv   ro   rw   s                           rG   rq   r   (  r   r   ry   c               l  #    U R                  S[        0 SU_SU_SU_SU_SU_SU_SU_S	U_S
U	_SU
_SU_SU_SU_SU_SU_SU_SU_UUS.EU(       a  [        R                  O[        R                  5      I S h  vN [        UUUUS9[        U=(       d    S[        [           S9I S h  vN $  N4 N7fr{   )	r   r   r+   r   r   r*   r1   r'   r<   rp   s                           rG   rq   r     s]    < ZZ,UU w #L	
 ():  *+> +,@   #L U f "; D ";  U!" U#$ #- ',  'DD+LL1 4 )+Q[el ?U"#67C   "
 "
 "	
"
s$   A9B4;B0
</B4+B2,B42B4r   c                   [        U5      (       a(  U(       d  0 nSU;   a  [        S5      e[        U5      US'   [        U5      nU R	                  UUUUUUUU	U
USUUUUUUUUUUUS9n[        UUUS9$ )Nr   r   T)rk   rl   rc   rV   rW   rX   rY   rZ   r[   r^   r_   r`   ra   rb   r\   rd   re   rf   rg   rh   ri   rj   r   )r   r   r   r   rq   r8   r   s                           rG   r_   AsyncResponses.stream"  s    8 K  4 STT7DDNE"kk%/ 3!5##!'#!- " 
2 *#
 	
rJ   r   c                 ^^#    [        T5      (       a(  U(       d  0 nSU;   a  [        S5      e[        T5      US'   [        T5      mSUU4S jjnU R	                  S[        0 SU_SU_SU_SU_S	U_S
U_SU	_SU
_SU_SU_SU_SU_SU_SU_ST_SU_SU_SU0E[        R                  5      [        UUUUUS9[        [        [        [              [        5      S9I S h  vN $  N7f)Nr   r   c                   > [        TTU S9$ r   r   r   s    rG   r   $AsyncResponses.parse.<locals>.parser  r   rJ   r|   rk   rl   rV   rW   rX   rY   rZ   r[   r\   r^   r_   r`   ra   rb   rc   rd   re   rf   r   r   r   r   r   s      ``                    rG   r   AsyncResponses.parseh  s    : K  4 STT7DDNE"	 	 ZZ UU w #L	
 ():  *+> +,@   U f "; D "; U  U!" !*#$ D%( ';;+. )+'%" n[9:HEE   #
 #
 #	
 #
s   CC' C%!C'r   c                  #    U(       d  [        SU< 35      eU R                  SU 3[        UUUU[        SU0[        R
                  5      I Sh  vN S9[        S9I Sh  vN $  N N7f)r   r   r   rV   Nr   r   )r   r   r*   r   r,   r   r1   r   s          rG   r   AsyncResponses.retrieve  s     6 YZeYhijjYY+'(+'%1(*B*Y*Y    
 
 	

s$   AA*A&A*!A("A*(A*r}   c          
        #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)r   r   r   r   r   r}   r   Nr   r   s         rG   r   AsyncResponses.delete  sp     . YZeYhijj!5B]-@bB\\+'(+Q[  " 
 
 	
 
s   A	AAAro   )r   r!   )r   r   )r   r   r   )0rk   r   rl   r:   r_   r   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   z AsyncStream[ResponseStreamEvent])0rk   r   rl   r:   r_   r   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   +Response | AsyncStream[ResponseStreamEvent])0rk   r   rl   r:   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r]   r   r^   r   r_   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   r   ).rk   r   rl   r   r   r   rc   r   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r^   r   r`   r   ra   r   rb   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   r   z'AsyncResponseStreamManager[TextFormatT]r   r   r   r   ro   rJ   rG   r?   r?     s	   - - 3 3 9 9  BK1:6?2;9B9B4=PY+46?2;3<DM09,5GP( )-$("&;D7u .u 	u
 ?u /u 4u 0u 7u 7u 2u Nu )u 4u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
9u un  BK1:6?2;9B9B4=PY+42;3<DM09,5GP( )-$("&;D7u .u 	u
 u ?u /u 4u 0u 7u 7u 2u Nu )u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
*9u un  BK1:6?2;9B9B4=PY+42;3<DM09,5GP( )-$("&;D7u .u 	u
 u ?u /u 4u 0u 7u 7u 2u Nu )u 0u  1!u" B#u$ .%u& *'u( E)u* +u0 &1u2 "3u4  5u6 97u8 
59u un GW%'CD BK1:6?2;9B9B4=PY+4FO2;3<DM09,5GP( )-$("&;D7?
 .?
 	?

 ??
 /?
 4?
 0?
 7?
 7?
 2?
 N?
 )?
 D?
 0?
  1!?
" B#?
$ .%?
& *'?
( E)?
* +?
0 &1?
2 "3?
4  5?
6 97?
8 
59?
 E?
L 5>9BAJ1:6?2;9B9B4=+42;3<DM,5GP( )-$("&;D5D
 .D
 %	D

 2D
 7D
 ?D
 /D
 4D
 0D
 7D
 7D
 2D
 )D
 0D
  1!D
" B#D
$ *%D
& E'D
( )D
. &/D
0 "1D
2  3D
4 95D
6 
17D
V 5>9BAJ1:6?2;9B9B4=+4FO2;3<DM,5GP( )-$("&;D7R
 .R
 %	R

 2R
 7R
 ?R
 /R
 4R
 0R
 7R
 7R
 2R
 )R
 DR
  0!R
" 1#R
$ B%R
& *'R
( E)R
* +R
0 &1R
2 "3R
4  5R
6 97R
8 
%9R
p 8A )-$("&;D)
)
 5	)
 &)
 ")
  )
 9)
 
)
b )-$("&;D 
 
 & 
 " 
   
 9 
 
 
  
rJ   c                  2    \ rS rSrSS jr\SS j5       rSrg)rM   i
  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        g rC   )
_responsesr   to_raw_response_wrapperrq   r   r   rF   	responsess     rG   __init__!ResponsesWithRawResponse.__init__  s\    #&>>
 )@@
 '>>
rJ   c                @    [        U R                  R                  5      $ rC   )r"   r  rH   rE   s    rG   rH   $ResponsesWithRawResponse.input_items  s    ()D)DEErJ   r  rq   r   r   Nr  r>   r   r   )r   r"   r   r   r   r   r  r   rH   r   ro   rJ   rG   rM   rM   
  s    
 F FrJ   rM   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   i  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        g rC   )r  r   async_to_raw_response_wrapperrq   r   r   r  s     rG   r  &AsyncResponsesWithRawResponse.__init__  s\    #&DD
 )FF
 'DD
rJ   c                @    [        U R                  R                  5      $ rC   )r#   r  rH   rE   s    rG   rH   )AsyncResponsesWithRawResponse.input_items+  s    -doo.I.IJJrJ   r
  Nr  r?   r   r   )r   r#   r  ro   rJ   rG   r   r     s    
 K KrJ   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)rR   i0  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g rC   )r  r   rq   r   r   r  s     rG   r  'ResponsesWithStreamingResponse.__init__1  sJ    #2
 5
 3
rJ   c                @    [        U R                  R                  5      $ rC   )r$   r  rH   rE   s    rG   rH   *ResponsesWithStreamingResponse.input_items>  s    .t/J/JKKrJ   r
  Nr  )r   r$   r  ro   rJ   rG   rR   rR   0  s    
 L LrJ   rR   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   iC  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g rC   )r  r   rq   r   r   r  s     rG   r  ,AsyncResponsesWithStreamingResponse.__init__D  sJ    #8
 ;
 9
rJ   c                @    [        U R                  R                  5      $ rC   )r%   r  rH   rE   s    rG   rH   /AsyncResponsesWithStreamingResponse.input_itemsQ  s    3DOO4O4OPPrJ   r
  Nr  )r   r%   r  ro   rJ   rG   r   r   C  s    
 Q QrJ   r   c           
        [        U 5      (       d  [        $ / nU  H  nUS   S:w  a  UR                  U5        M  SU;  a  UR                  U5        M8  [        [        U5      S   n[        U[        5      (       d  [        S5      eSU;   d   e[        SUS   UR                  S5      US   UR                  S5      =(       d    SS	.UR                  5      nUR                  UR                  5       5        M     U$ )
NtypefunctionzcExpected Chat Completions function tool shape to be created using `openai.pydantic_function_tool()`
parametersnamedescriptionstrictF)r  r"  r#  r!  r$  )r   r   appendr
   r   
isinstancer(   	Exceptionr)   getrl   )rc   converted_toolstoolr   new_tools        rG   r   r   V  s    E??')O<:%""4(T!""4(T?:.($899u  x'''0" ('||M:&|4",,x09E NN	
 	x}}/9 < rJ   )rc   r   r   zList[ToolParam] | NotGiven)_
__future__r   typingr   r   r   r   r   r	   r
   	functoolsr   typing_extensionsr   r   httpx r   _typesr   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   rH   r    r!   r"   r#   r$   r%   
_streamingr&   r'   
lib._toolsr(   r)   _base_clientr*   types.responsesr+   r,   lib._parsing._responsesr-   r.   r/   r   types.shared.chat_modelr0   types.responses.responser1   types.responses.tool_paramr2   r3   types.shared_params.metadatar4   types.shared_params.reasoningr5   types.responses.parsed_responser6   "lib.streaming.responses._responsesr7   r8   #types.responses.response_includabler9   #types.shared_params.responses_modelr:   $types.responses.response_input_paramr;   %types.responses.response_stream_eventr<   *types.responses.response_text_config_paramr=   __all__r>   r?   rM   r   rR   r   r   ro   rJ   rG   <module>rI     s    # C C C  /    I I  ' : Y  . M 0 O 
 1 0 G 4 6 = c E A F H Q(
)f
 f
Rg
% g
TF F&K K&L L&Q Q&#rJ   