
    2h8                   f   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  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K/J0r0J1r1  SSK2J3r3  SSK4J5r5J6r6  SSK7J8r8J9r9J:r;  SSK<J=r=  SSK>J?r?  SSK@JArAJBrB  SSKCJDrD  SSKEJFrF  SSKGJHrH  SSKIJJrJJKrK  SSKLJMrM  SSKNJOrO  SSKPJQrQ  SSKRJSrS  SSKTJUrU  SS KVJWrW  S!S"/rX " S# S!\ 5      rY " S$ S"\!5      rZ " S% S&5      r[ " 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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)ResponsePromptParam)ResponseStreamEvent)ResponseTextConfigParam	ResponsesAsyncResponsesc                     \ 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\	S.                                                       S)S jj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r\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                                         S-S jj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.                 S0S jj5       r\S\	\	SSS\	S.                 S0S jj5       r\\	\	SSS\	S.                 S/S jj5       r\\	\	SSS\	S.                 S0S jj5       r\	\	\	SSS\	S.                 S1S jjrSSS\	S.           S2S  jjrSSS\	S.           S3S! jjrS"rg)4r>   3   c                ,    [        U R                  5      $ N)r   _clientselfs    \/var/www/auris/envauris/lib/python3.13/site-packages/openai/resources/responses/responses.pyinput_itemsResponses.input_items4   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_response8   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_responseB   s     .d33rJ   N
backgroundincludeinputinstructionsmax_output_tokensmax_tool_callsmetadatamodelparallel_tool_callsprevious_response_idprompt	reasoningservice_tierstorestreamtemperaturetexttool_choicetoolstop_logprobstop_p
truncationuserextra_headersextra_query
extra_bodytimeoutc                   ga9#  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:
  background: Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

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

      - `code_interpreter_call.outputs`: Includes the outputs of python code execution
        in code interpreter tool call items.
      - `computer_call_output.output.image_url`: Include image urls from the computer
        call output.
      - `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.
      - `message.output_text.logprobs`: Include logprobs with assistant messages.
      - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
        tokens in reasoning item outputs. This enables reasoning items to be used in
        multi-turn conversations when using the Responses API statelessly (like when
        the `store` parameter is set to `false`, or when an organization is enrolled
        in the zero data retention program).

  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)

  instructions: A system (or developer) message inserted into 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).

  max_tool_calls: The maximum number of total calls to built-in tools that can be processed in a
      response. This maximum number applies across all built-in tool calls, not per
      individual tool. Any further attempts to call a tool by the model will be
      ignored.

  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.

  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.

  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).

  prompt: Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

  reasoning: **o-series models only**

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

  service_tier: 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 requset will be processed with the standard
        pricing and performance for the selected model.
      - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
        'priority', then the request will be processed with the corresponding service
        tier. [Contact sales](https://openai.com/contact-sales) to learn more about
        Priority processing.
      - 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.

  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_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.

  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 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](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   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   s                               rG   createResponses.createK       ^ 	rJ   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   c                   ga9#  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:
  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.

  background: Whether to run the model response in the background.
      [Learn more](https://platform.openai.com/docs/guides/background).

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

      - `code_interpreter_call.outputs`: Includes the outputs of python code execution
        in code interpreter tool call items.
      - `computer_call_output.output.image_url`: Include image urls from the computer
        call output.
      - `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.
      - `message.output_text.logprobs`: Include logprobs with assistant messages.
      - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
        tokens in reasoning item outputs. This enables reasoning items to be used in
        multi-turn conversations when using the Responses API statelessly (like when
        the `store` parameter is set to `false`, or when an organization is enrolled
        in the zero data retention program).

  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)

  instructions: A system (or developer) message inserted into 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).

  max_tool_calls: The maximum number of total calls to built-in tools that can be processed in a
      response. This maximum number applies across all built-in tool calls, not per
      individual tool. Any further attempts to call a tool by the model will be
      ignored.

  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.

  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.

  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).

  prompt: Reference to a prompt template and its variables.
      [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

  reasoning: **o-series models only**

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

  service_tier: 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 requset will be processed with the standard
        pricing and performance for the selected model.
      - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
        'priority', then the request will be processed with the corresponding service
        tier. [Contact sales](https://openai.com/contact-sales) to learn more about
        Priority processing.
      - 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.

  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_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.

  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 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](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
Nrs   rF   rd   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   s                               rG   ru   rv     rw   rJ   c                   grz   rs   r{   s                               rG   ru   rv     rw   rJ   c               D   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UUUUS.EU(       a  [        R                  O[        R                  5      [        UUUUS9[        U=(       d    S[        [           S9$ N
/responsesrV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   F)bodyoptionscast_tord   
stream_cls)	_postr   r*   ResponseCreateParamsStreaming ResponseCreateParamsNonStreamingr)   r0   r%   r<   rt   s                               rG   ru   rv     sS   B zz  *w U #L	
 (): %n  U *+> +,@ f   #L U f  ";!" D#$ $/"$0"", /4  'DD+LL9< )+Q[el ?U12K  &
 &	
rJ   text_formatstarting_afterrh   rm   rn   ro   rp   c                   g rC   rs   	rF   response_idr   r   rh   rm   rn   ro   rp   s	            rG   rd   Responses.stream  s     .1rJ   rV   r   rh   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   rm   rn   ro   rp   c                   g rC   rs   rF   rX   r]   rV   r   rh   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   rm   rn   ro   rp   s                           rG   rd   r     s    : .1rJ   r   rX   r]   rV   r   rh   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   r   rm   rn   ro   rp   c          	       ^ ^^^^^^ 0 SU_SU_ST_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_nUR                  5        VVs/ s H  u  nn[        U5      (       d  M  UPM     nnn[        T5      (       d  [        U5      (       a,  [        U5      S:  a  [        SSR	                  U5      -   5      e[        U5      n[        U5      S:  a  [        U5      (       d  [        S5      e[        U5      (       d  [        S5      e[        U5      (       a(  U(       d  0 nSU;   a  [        S5      e[        U5      US'   [        T R                  40 SU_SU_SU_ST_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T_ST_ST_ST_6n[        UXVS S 9$ [        T5      (       d  [        S!5      e[        UUUUUU U4S" jUU[        U5      (       a  US 9$ S S 9$ s  snnf )#NrX   r]   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   rV   r   OCannot provide both response_id/starting_after can't be provided together with , 3input must be provided when creating a new response3model must be provided when creating a new responseformat1Cannot mix and match text.format with text_formatrh   rd   Trm   rn   ro   rp   r   input_toolsr   z7id must be provided when streaming an existing responsec                 J   > TR                  TST=(       d    / TTT [        TS9$ )NT)r   rd   rW   rm   rn   ro   r   rp   )retriever   )ro   rm   rn   rW   r   rF   rp   s   rG   <lambda>"Responses.stream.<locals>.<lambda>  s/     +#Mr"/ +)#,# & 	rJ   )itemsr   len
ValueErrorjoin_make_tools	TypeError_type_to_text_format_paramr   ru   r6   rF   r   rX   r]   rV   r   rh   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   r   rm   rn   ro   rp   new_response_argskvnew_response_args_namesapi_requests   ``     `              ````     rG   rd   r   5  s<   >
U
U
 w
 L	

  !2
 
 "#6
 #$8
 
 U
 ;
 D
 ;
 U
 *
  D!
" *#
& 2C1H1H1J"Z1JAhWXk11J"Z[!!Xn%=%=3G^C_bcCca))345  E"&'!+E?? !VWWE?? !VWW$$Dt##$WXX!;K!HX@GAA A 	A
  A *A #4A "A %8A &:A A A (A A (A  $!A" #A$ &%A& 'A( &)A* ,+A, (-A. &/A0  1AK6 )+quvvK(( !Z[[(	 	 (!19.1I1I~  PT q #[s   G1+G1r   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   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U_SU_SU_UTUUUUS.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   rh   s    rG   parserResponses.parse.<locals>.parser      !!'% rJ   r   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r   rm   rn   ro   rp   post_parserr   r   r   r   r0   returnParsedResponse[TextFormatT]r   r   r   r   r   r   r*   ResponseCreateParamsr)   r
   r   r5   r,   r0   rF   r   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   r   s    `                  `         rG   parseResponses.parse  s   D K  4 STT7DDNE"	 	 zz  *w U #L	
 (): %n  U *+> +,@ f   #L U f  ";!" D#$ $/"$0"", /2 ';;58 )+'%" n[9:HEO  (
 (	
rJ   rW   r   rd   rm   rn   ro   rp   c                   g rC   rs   	rF   r   rW   r   rd   rm   rn   ro   rp   s	            rG   r   Responses.retrieve  s     rJ   rW   r   rm   rn   ro   rp   c                   g rC   rs   	rF   r   rd   rW   r   rm   rn   ro   rp   s	            rG   r   r     s     '*rJ   c                   g rC   rs   r   s	            rG   r   r   -  s     25rJ   Frd   rW   r   rm   rn   ro   rp   c                   ga  
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.

  starting_after: The sequence number of the event after which to start streaming.

  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.

  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
Nrs   r   s	            rG   r   r   =      N 	rJ   c                   ga  
Retrieves a model response with the given ID.

Args:
  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: Additional fields to include in the response. See the `include` parameter for
      Response creation above for more information.

  starting_after: The sequence number of the event after which to start streaming.

  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
Nrs   r   s	            rG   r   r   f  r   rJ   c                   gr   rs   r   s	            rG   r   r     r   rJ   c                   U(       d  [        SU< 35      eU R                  SU 3[        UUUU[        UUUS.[        R
                  5      S9[        U=(       d    S[        [           S9$ N:Expected a non-empty value for `response_id` but received /responses/)rW   r   rd   )rm   rn   ro   rp   queryF)r   r   rd   r   )	r   _getr)   r   r+   ResponseRetrieveParamsr0   r%   r<   r   s	            rG   r   r     s     YZeYhijjyy+'(+'%%#**8"(
 -CC ?U12%  
 	
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   r   _deleter)   r   rF   r   rm   rn   ro   rp   s         rG   deleteResponses.delete  sc    . YZeYhijj!5B]-@bB||+'(+Q[   
 	
rJ   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  Cancels a model response with the given ID.

Only responses created with the
`background` parameter set to `true` can be cancelled.
[Learn more](https://platform.openai.com/docs/guides/background).

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   r   /cancelr   r   r   r   r)   r0   r   s         rG   cancelResponses.cancel  sQ    4 YZeYhijjzz+g.(+Q[   
 	
rJ   rs   )r   r   )r   rM   )r   rR   8rV   Optional[bool] | NotGivenrW   -Optional[List[ResponseIncludable]] | NotGivenrX   )Union[str, ResponseInputParam] | NotGivenrY   Optional[str] | NotGivenrZ   Optional[int] | NotGivenr[   r   r\   Optional[Metadata] | NotGivenr]   ResponsesModel | NotGivenr^   r   r_   r   r`   (Optional[ResponsePromptParam] | NotGivenra   Optional[Reasoning] | NotGivenrb   LOptional[Literal['auto', 'default', 'flex', 'scale', 'priority']] | NotGivenrc   r   rd   z#Optional[Literal[False]] | NotGivenre   Optional[float] | NotGivenrf   "ResponseTextConfigParam | NotGivenrg   ,response_create_params.ToolChoice | NotGivenrh   Iterable[ToolParam] | NotGivenri   r   rj   r   rk   0Optional[Literal['auto', 'disabled']] | NotGivenrl   str | NotGivenrm   Headers | Nonern   Query | Nonero   Body | Nonerp   'float | httpx.Timeout | None | NotGivenr   r0   )8rd   Literal[True]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   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   Stream[ResponseStreamEvent])8rd   boolrV   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   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   &Response | Stream[ResponseStreamEvent])8rV   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   3Optional[Literal[False]] | Literal[True] | NotGivenre   r   rf   r   rg   r   rh   r   ri   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   r  )r   strr   type[TextFormatT] | NotGivenr   int | NotGivenrh   'Iterable[ParseableToolParam] | NotGivenrm   r   rn   r   ro   r   rp   r   r   "ResponseStreamManager[TextFormatT])0rX   Union[str, ResponseInputParam]r]   Union[str, ChatModel]rV   r   r   r  rh   r  rW   r   rY   r   rZ   r   r\   r   r^   r   r_   r   ra   r   rc   r   re   r   rf   r   rg   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   r  )4r   r   rX   r   r]    Union[str, ChatModel] | NotGivenrV   r   r   r  rh   r  rW   r   rY   r   rZ   r   r\   r   r^   r   r_   r   ra   r   rc   r   re   r   rf   r   rg   r   rj   r   rk   r   rl   r   r   r  rm   r   rn   r   ro   r   rp   r   r   r  :r   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   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   r   r   r  rW   #List[ResponseIncludable] | NotGivenr   r  rd   zLiteral[False] | NotGivenrm   r   rn   r   ro   r   rp   r   r   r0   )r   r  rd   r   rW   r  r   r  rm   r   rn   r   ro   r   rp   r   r   r   )r   r  rd   r  rW   r  r   r  rm   r   rn   r   ro   r   rp   r   r   r  )r   r  rW   r  r   r  rd   )Literal[False] | Literal[True] | NotGivenrm   r   rn   r   ro   r   rp   r   r   r  r   r  rm   r   rn   r   ro   r   rp   r   r   Noner   r  rm   r   rn   r   ro   r   rp   r   r   r0   __name__
__module____qualname____firstlineno__r   rH   rN   rS   r   r   ru   rd   r   r   r   r   __static_attributes__rs   rJ   rG   r>   r>   3   s   ( ( . . 4 4  1:AJ;D1:6?3<2;+49B9B;D4=en+46?2;3<DM091:,5GP( )-$("&;D?N .N ?	N
 9N /N 4N 1N 0N )N 7N 7N 9N 2N cN  )!N" 4#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
AN N` 
 1:AJ;D1:6?3<2;+49B9B;D4=en+42;3<DM091:,5GP( )-$("&;D?N N .	N
 ?N 9N /N 4N 1N 0N )N 7N 7N 9N 2N  c!N" )#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
%AN N` 
 1:AJ;D1:6?3<2;+49B9B;D4=en+42;3<DM091:,5GP( )-$("&;D?N N .	N
 ?N 9N /N 4N 1N 0N )N 7N 7N 9N 2N  c!N" )#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
0AN Nf 1:AJ;D1:6?3<2;+49B9B;D4=en+4FO2;3<DM091:,5GP( )-$("&;D?G
 .G
 ?	G

 9G
 /G
 4G
 1G
 0G
 )G
 7G
 7G
 9G
 2G
 cG
  )!G
" D#G
$ 0%G
& 1'G
( B)G
* .+G
, /-G
. */G
0 E1G
2 3G
8 &9G
: ";G
<  =G
> 9?G
@ 
0AG
R 
 5>)29B(,$("&;D1 1 2	1
 '1 71 &1 "1  1 91 
,1 1  1:4=9BAJ1:6?2;9B9B4=+42;3<DM,5GP( )-$("&;D71 .1 %	1
 .1 21 71 ?1 /1 41 01 71 71 21 )1  0!1" 1#1$ B%1& *'1( E)1* +10 &112 "314  516 9718 
,91 1B '0;D2;094=9BAJ1:6?2;9B9B4=+42;3<DM,5GP()2 )-$("&;D;x $x 9	x
 0x .x 2x 7x ?x /x 4x 0x 7x 7x 2x  )!x" 0#x$ 1%x& B'x( *)x* E+x, -x. '/x4 &5x6 "7x8  9x: 9;x< 
,=xz 5>09AJ;D1:6?3<2;+49B9B;D4=en+4FO2;3<DM9B1:,5GP( )-$("&;DA\
 2\
 .	\

 ?\
 9\
 /\
 4\
 1\
 0\
 )\
 7\
 7\
 9\
 2\
  c!\
" )#\
$ D%\
& 0'\
( 1)\
* B+\
, 7-\
. //\
0 *1\
2 E3\
4 5\
: &;\
< "=\
>  ?\
@ 9A\
B 
%C\
| 
 8A)2,5 )-$("&;D 5	
 ' * & "   9 
   8A)2 )-$("&;D** 	*
 5* '* &* "*  * 9* 
%* *  8A)2 )-$("&;D55 	5
 55 '5 &5 "5  5 95 
05 5 
 7@)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
0& &P  8A)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
%& &P  8A)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
0& &X 8A)2<E )-$("&;D#
#
 5	#

 '#
 :#
 &#
 "#
  #
 9#
 
0#
V )-$("&;D 
 
 & 
 " 
   
 9 
 
 
P )-$("&;D"
"
 &"
 ""
  "
 9"
 
"
 "
rJ   c                     \ 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\	S.                                                       S)S jj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r\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	\	SSS\	S.                                                         S-S jj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.                 S0S jj5       r\S\	\	SSS\	S.                 S0S jj5       r\\	\	SSS\	S.                 S/S jj5       r\\	\	SSS\	S.                 S0S jj5       r\	\	\	SSS\	S.                 S1S jjrSSS\	S.           S2S  jjrSSS\	S.           S3S! jjrS"rg)4r?   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_response3  s     3488rJ   NrU   c                  #    g7frr   rs   rt   s                               rG   ru   AsyncResponses.create<       ^ 	   rx   c                  #    g7frz   rs   r{   s                               rG   ru   r#    r$  r%  c                  #    g7frz   rs   r{   s                               rG   ru   r#    r$  r%  c               t  #    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U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)   r0   r&   r<   rt   s                               rG   ru   r#    sj    B ZZ, *w U #L	
 (): %n  U *+> +,@ f   #L U f  ";!" D#$ $/"$0"", /4  'DD+LL9 < )+Q[el ?U"#67K   &
 &
 &	
&
s$   A=B8?B4
 /B8/B60B86B8r   c                   g rC   rs   r   s	            rG   rd   AsyncResponses.stream  s     36rJ   r   c                   g rC   rs   r   s                           rG   rd   r*    s    : 36rJ   r   c                  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_nUR                  5        VVs/ s H  u  nn[        U5      (       d  M  UPM     nnn[        U5      (       d  [        U5      (       a,  [        U5      S:  a  [        SSR	                  U5      -   5      e[        U5      n[        U5      S:  a  [        U[        5      (       a  [        S5      e[        U5      (       d  [        S5      e[        U5      (       a(  U(       d  0 nSU;   a  [        S5      e[        U5      US'   U R                  UUSUUUU	U
UUUUUUUUUUUUUUS9n[        UUUS S9$ [        U[        5      (       a  [        S5      eU R                  USU=(       d    / UUUUS9n[        UUU[        U5      (       a  US9$ S S9$ s  snnf )NrX   r]   rW   rY   rZ   r\   r^   r_   ra   rc   re   rf   rg   rj   rk   rl   rV   r   r   r   r   r   r   r   T)rX   r]   rd   rh   rW   rY   rZ   r\   r^   r_   rc   re   rf   rg   ra   rj   rk   rl   rm   rn   ro   rp   r   z@response_id must be provided when streaming an existing response)rd   rW   rm   rn   ro   rp   )r   r   r   r   r   r   
isinstancer   r   r   ru   r7   r   r   s                                  rG   rd   r*  &  s   >
U
U
 w
 L	

  !2
 
 "#6
 #$8
 
 U
 ;
 D
 ;
 U
 *
  D!
" *#
& 2C1H1H1J"Z1JAhWXk11J"Z[!!Xn%=%=3G^C_bcCca))345 
 E"&'!+%** !VWWE?? !VWW$$Dt##$WXX!;K!HX++)"3!$7%9''#%+'%- & K2 .'!#	  +x00 !cdd--2+'% ( K .'!19.1I1I~	  PT	 K #[s   	G$G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U_SU_SU_UTUUUUS.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   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r   r   r   r   r   r   s    `                  `         rG   r   AsyncResponses.parse  s    D K  4 STT7DDNE"	 	 ZZ  *w U #L	
 (): %n  U *+> +,@ f   #L U f  ";!" D#$ $/"$0"", /2 ';;58 )+'%" n[9:HEO   (
 (
 (	
 (
s   C!C,%C*&C,r   c                  #    g 7frC   rs   r   s	            rG   r   AsyncResponses.retrieve	  s
      r%  r   c                  #    g 7frC   rs   r   s	            rG   r   r3  	  s
      ,/r%  c                  #    g 7frC   rs   r   s	            rG   r   r3  "	  s
      7:r%  Fr   c                  #    g7fr   rs   r   s	            rG   r   r3  2	       N 	r%  c                  #    g7fr   rs   r   s	            rG   r   r3  [	  r7  r%  c                  #    g7fr   rs   r   s	            rG   r   r3  	  r7  r%  c                 #    U(       d  [        SU< 35      eU R                  SU 3[        UUUU[        UUUS.[        R
                  5      I S h  vN S9[        U=(       d    S[        [           S9I S h  vN $  N+ N7fr   )	r   r   r)   r   r+   r   r0   r&   r<   r   s	            rG   r   r3  	  s      YZeYhijjYY+'(+'%1#**8"(
 -CC  ?U"#67%  
 
 	

s$   ABA>&B9B :B B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c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)r   r   r   r   r   r   Nr   r   s         rG   r   AsyncResponses.cancel	  s^     4 YZeYhijjZZ+g.(+Q[    
 
 	
 
s   ;AAArs   )r   r    )r   r  )r   r   r   )8rd   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   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r    AsyncStream[ResponseStreamEvent])8rd   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   re   r   rf   r   rg   r   rh   r   ri   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   +Response | AsyncStream[ResponseStreamEvent])8rV   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   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   r@  )r   r  r   r  r   r  rh   r  rm   r   rn   r   ro   r   rp   r   r   'AsyncResponseStreamManager[TextFormatT])0rX   r	  r]   r
  rV   r   r   r  rh   r  rW   r   rY   r   rZ   r   r\   r   r^   r   r_   r   ra   r   rc   r   re   r   rf   r   rg   r   rj   r   rk   r   rl   r   rm   r   rn   r   ro   r   rp   r   r   rA  )4r   r   rX   r   r]   r  rV   r   r   r  rh   r  rW   r   rY   r   rZ   r   r\   r   r^   r   r_   r   ra   r   rc   r   re   r   rf   r   rg   r   rj   r   rk   r   rl   r   r   r  rm   r   rn   r   ro   r   rp   r   r   rA  r  r  )r   r  rd   r   rW   r  r   r  rm   r   rn   r   ro   r   rp   r   r   r?  )r   r  rd   r  rW   r  r   r  rm   r   rn   r   ro   r   rp   r   r   r@  )r   r  rW   r  r   r  rd   r  rm   r   rn   r   ro   r   rp   r   r   r@  r  r  r  rs   rJ   rG   r?   r?   $  s   - - 3 3 9 9  1:AJ;D1:6?3<2;+49B9B;D4=en+46?2;3<DM091:,5GP( )-$("&;D?N .N ?	N
 9N /N 4N 1N 0N )N 7N 7N 9N 2N cN  )!N" 4#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
AN N` 
 1:AJ;D1:6?3<2;+49B9B;D4=en+42;3<DM091:,5GP( )-$("&;D?N N .	N
 ?N 9N /N 4N 1N 0N )N 7N 7N 9N 2N  c!N" )#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
*AN N` 
 1:AJ;D1:6?3<2;+49B9B;D4=en+42;3<DM091:,5GP( )-$("&;D?N N .	N
 ?N 9N /N 4N 1N 0N )N 7N 7N 9N 2N  c!N" )#N$ 0%N& 1'N( B)N* .+N, /-N. */N0 E1N2 3N8 &9N: ";N<  =N> 9?N@ 
5AN Nf 1:AJ;D1:6?3<2;+49B9B;D4=en+4FO2;3<DM091:,5GP( )-$("&;D?G
 .G
 ?	G

 9G
 /G
 4G
 1G
 0G
 )G
 7G
 7G
 9G
 2G
 cG
  )!G
" D#G
$ 0%G
& 1'G
( B)G
* .+G
, /-G
. */G
0 E1G
2 3G
8 &9G
: ";G
<  =G
> 9?G
@ 
5AG
R 
 5>)29B(,$("&;D6 6 2	6
 '6 76 &6 "6  6 96 
16 6  1:4=9BAJ1:6?2;9B9B4=+42;3<DM,5GP( )-$("&;D76 .6 %	6
 .6 26 76 ?6 /6 46 06 76 76 26 )6  0!6" 1#6$ B%6& *'6( E)6* +60 &162 "364  566 9768 
196 6B '0;D2;094=9BAJ1:6?2;9B9B4=+42;3<DM,5GP()2 )-$("&;D;| $| 9	|
 0| .| 2| 7| ?| /| 4| 0| 7| 7| 2|  )!|" 0#|$ 1%|& B'|( *)|* E+|, -|. '/|4 &5|6 "7|8  9|: 9;|< 
1=|B 5>09AJ;D1:6?3<2;+49B9B;D4=en+4FO2;3<DM9B1:,5GP( )-$("&;DA\
 2\
 .	\

 ?\
 9\
 /\
 4\
 1\
 0\
 )\
 7\
 7\
 9\
 2\
  c!\
" )#\
$ D%\
& 0'\
( 1)\
* B+\
, 7-\
. //\
0 *1\
2 E3\
4 5\
: &;\
< "=\
>  ?\
@ 9A\
B 
%C\
| 
 8A)2,5 )-$("&;D 5	
 ' * & "   9 
   8A)2 )-$("&;D// 	/
 5/ '/ &/ "/  / 9/ 
*/ /  8A)2 )-$("&;D:: 	:
 5: ': &: ":  : 9: 
5: : 
 7@)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
5& &P  8A)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
*& &P  8A)2 )-$("&;D&& 	&
 5& '& && "&  & 9& 
5& &X 8A)2<E )-$("&;D#
#
 5	#

 '#
 :#
 &#
 "#
  #
 9#
 
5#
V )-$("&;D 
 
 & 
 " 
   
 9 
 
 
P )-$("&;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        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g rC   )
_responsesr   to_raw_response_wrapperru   r   r   r   r   rF   	responsess     rG   __init__!ResponsesWithRawResponse.__init__
  s    #&>>
 )@@
 '>>
 '>>
 &==OO

rJ   c                @    [        U R                  R                  5      $ rC   )r!   rD  rH   rE   s    rG   rH   $ResponsesWithRawResponse.input_items-
  s    ()D)DEErJ   rD  r   ru   r   r   r   NrG  r>   r   r  )r   r!   r  r  r  r  rH  r   rH   r  rs   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  i2
  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g rC   )rD  r   async_to_raw_response_wrapperru   r   r   r   r   rF  s     rG   rH  &AsyncResponsesWithRawResponse.__init__3
  s    #&DD
 )FF
 'DD
 'DD
 &CCOO

rJ   c                @    [        U R                  R                  5      $ rC   )r"   rD  rH   rE   s    rG   rH   )AsyncResponsesWithRawResponse.input_itemsF
  s    -doo.I.IJJrJ   rL  NrG  r?   r   r  )r   r"   rN  rs   rJ   rG   r  r  2
  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   iK
  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g rC   )rD  r   ru   r   r   r   rF  s     rG   rH  'ResponsesWithStreamingResponse.__init__L
  sa    #2
 5
 3
 3
rJ   c                @    [        U R                  R                  5      $ rC   )r#   rD  rH   rE   s    rG   rH   *ResponsesWithStreamingResponse.input_items\
  s    .t/J/JKKrJ   rD  r   ru   r   r   NrM  )r   r#   rN  rs   rJ   rG   rR   rR   K
  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   ia
  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g rC   )rD  r   ru   r   r   r   rF  s     rG   rH  ,AsyncResponsesWithStreamingResponse.__init__b
  sa    #8
 ;
 9
 9
rJ   c                @    [        U R                  R                  5      $ rC   )r$   rD  rH   rE   s    rG   rH   /AsyncResponsesWithStreamingResponse.input_itemsr
  s    3DOO4O4OPPrJ   r[  NrU  )r   r$   rN  rs   rJ   rG   r   r   a
  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)rb  re  rf  rd  rg  )r   r   appendr
   r   r-  r'   	Exceptionr(   getr]   )rh   converted_toolstoolrc  new_tools        rG   r   r   w
  s    E??')O<:%""4(T!""4(T?:.($899u  x'''0" ('||M:&|4",,x09E NN	
 	x}}/9 < rJ   )rh   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   _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_modelr/   types.responses.responser0   types.responses.tool_paramr1   r2   types.shared_params.metadatar3   types.shared_params.reasoningr4   types.responses.parsed_responser5   "lib.streaming.responses._responsesr6   r7   #types.responses.response_includabler8   #types.shared_params.responses_modelr9   $types.responses.response_input_paramr:   %types.responses.response_prompt_paramr;   %types.responses.response_stream_eventr<   *types.responses.response_text_config_paramr=   __all__r>   r?   rM   r  rR   r   r   rs   rJ   rG   <module>r     s    # C C C  /    I I F F & : Y  . M 0 O 
 1 0 G 4 6 = c E A F H H Q(
)n
 n
b'r
% r
j'F F2K K2L L,Q Q,#rJ   