+
    Uie	                   R  a  0 t $ ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	H
t
HtHtHtHtHtHtHtHt ^ RIHt ^ RIHtHt ^ RIt^ RIHt ^R	IHt ^R
IHtHtH t H!t!H"t"H#t#H$t$H%t%H&t& ^RI'H(t(H)t)H*t*H+t+H,t, ^RI-H.t. ^RI/H0t0 ^RI1H2t2H3t3 ^RI4H5t5H6t6 ^RI7H8t8H9t9H:t:H;t;H<t<H=t= ^RI>H?t?H@t@ ^RIAHBtBHCtC ^RIDHEtEHFtFHGtGHHtHHItIHJtJ ^RIKHLtL ^RIMHNtNHOtO ^RIPHQtQHRtRHStSHTtT ^RIUHVtVHWtWHXtY ^RIZH[t[ ^RI\H]t]H^t^ ^RI_H`t` ^RIaHbtb ^RIcHdtd ^RIeHftfHgtg ^RIhHiti ^RIjHktk ^R IlHmtm ^R!InHoto ^R"IpHqtq ^R#IrHsts ^R$ItHutu ^R%IvHwtw ^R&IxHyty ^R'IzH{t{ ^R(I|H}t} ^R)I~Ht ]	'       d   ^ R*IHt ^ R*IHt ^R+IHtHt R,R-.t]EP                  ! ]4      tR.]R/&    ! R0 R,]24      t ! R1 R-]34      t ! R2 R34      t ! R4 R54      t ! R6 R74      t ! R8 R94      tR: R; lt ! R< R=4      t ! R> R?4      t ! R@ RA4      t ! RB RC4      t ! RD RE4      t ! RF RG]4      t ! RH RI4      t ! RJ RK]4      tR# )L    )annotationsN)copy)TracebackType)
TYPE_CHECKINGAnyListTypeUnionIterableIteratorOptionalAsyncIteratorcast)partial)Literaloverload)	BaseModel)_legacy_response)		NOT_GIVENBodyOmitQueryHeadersNoneTypeNotGivenomit	not_given)is_givenpath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)construct_type_unchecked)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)
InputItemsAsyncInputItemsInputItemsWithRawResponseAsyncInputItemsWithRawResponseInputItemsWithStreamingResponse$AsyncInputItemsWithStreamingResponse)StreamAsyncStream)PydanticFunctionToolResponsesPydanticFunctionTool)InputTokensAsyncInputTokensInputTokensWithRawResponseAsyncInputTokensWithRawResponse InputTokensWithStreamingResponse%AsyncInputTokensWithStreamingResponse)OpenAIError)_merge_mappingsmake_request_options)response_create_paramsresponse_compact_paramsresponse_retrieve_paramsresponses_client_event_param)TextFormatTparse_responsetype_to_text_format_param)Response)	ToolParamParseableToolParam)Metadata)	Reasoning)ParsedResponse)ResponseStreamManagerAsyncResponseStreamManager)CompactedResponse)WebSocketConnectionOptions)ResponseIncludable)ResponsesModel)ResponseInputParam)ResponsePromptParam)ResponseStreamEvent)ResponsesClientEvent)ResponsesServerEvent)ResponseInputItemParam)ResponseTextConfigParam)ResponsesClientEventParam)ClientConnection)OpenAIAsyncOpenAI	ResponsesAsyncResponseszlogging.Loggerlogc            F         ] tR t^Tt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]	R	]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&R'R(R'R)R'R*]/!R+ R, ll4       t]	R	]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&R'R(R'R)R'R*]/ R- R. ll4       t]	R	]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&R'R(R'R)R'R*]/ R/ R0 ll4       tR	]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&R'R(R'R)R'R*]/!R1 R2 llt]	R3]
R4]
R!]
R&R'R(R'R)R'R*]/R5 R6 ll4       t]	R	]
R
]
R3]
R!]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R"]
R#]
R$]
R%]
R&R'R(R'R)R'R*]/R7 R8 ll4       tR9]
R]
R]
R	]
R
]
R3]
R!]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R"]
R#]
R$]
R%]
R4]
R&R'R(R'R)R'R*]/#R: R; lltR3]
R	]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R<]
R&R'R(R'R)R'R*]/#R= R> llt]	R]
R?]
R4]
R]
R&R'R(R'R)R'R*]/R@ RA ll4       t]	R]
R4]
R&R'R(R'R)R'R*]/RB RC ll4       t]	R]
R4]
R&R'R(R'R)R'R*]/RD RE ll4       t]	RRFR]
R4]
R&R'R(R'R)R'R*]/RG RH ll4       t]	R]
R?]
R4]
R&R'R(R'R)R'R*]/RI RJ ll4       t]	R]
R?]
R4]
R&R'R(R'R)R'R*]/RK RL ll4       tR]
R?]
R4]
R]
R&R'R(R'R)R'R*]/RM RN lltR&R'R(R'R)R'R*]/RO RP lltR&R'R(R'R)R'R*]/RQ RR lltR]
R]
R]
R]
R&R'R(R'R)R'R*]/RS RT llt/ / / 3RU RV lltRWtR'# )XrZ   c                   V ^8  d   QhRR/# )   returnr)    )formats   "c/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/openai/resources/responses/responses.py__annotate__Responses.__annotate__V   s     ( (Z (    c                	,    \        V P                  4      # N)r)   _clientselfs   &rc   input_itemsResponses.input_itemsU   s    $,,''rf   c                   V ^8  d   QhRR/# )r_   r`   r3   ra   )rb   s   "rc   rd   re   Z   s     ) )k )rf   c                	,    \        V P                  4      # rh   )r3   ri   rj   s   &rc   input_tokensResponses.input_tokensY   s    4<<((rf   c                   V ^8  d   QhRR/# )r_   r`   ResponsesWithRawResponsera   )rb   s   "rc   rd   re   ^   s     . .#; .rf   c                    \        V 4      # 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
)rs   rj   s   &rc   with_raw_responseResponses.with_raw_response]   s     (--rf   c                   V ^8  d   QhRR/# )r_   r`   ResponsesWithStreamingResponsera   )rb   s   "rc   rd   re   h   s     4 4)G 4rf   c                    \        V 4      # 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
)ry   rj   s   &rc   with_streaming_response!Responses.with_streaming_responseg   s     .d33rf   
backgroundcontext_managementconversationincludeinputinstructionsmax_output_tokensmax_tool_callsmetadatamodelparallel_tool_callsprevious_response_idpromptprompt_cache_keyprompt_cache_retention	reasoningsafety_identifierservice_tierstorestreamstream_optionstemperaturetexttool_choicetoolstop_logprobstop_p
truncationuserextra_headersNextra_query
extra_bodytimeoutc          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"R#R$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# =r_   r~   Optional[bool] | Omitr   COptional[Iterable[response_create_params.ContextManagement]] | Omitr   4Optional[response_create_params.Conversation] | Omitr   )Optional[List[ResponseIncludable]] | Omitr   %Union[str, ResponseInputParam] | Omitr   Optional[str] | Omitr   Optional[int] | Omitr   r   Optional[Metadata] | Omitr   ResponsesModel | Omitr   r   r   $Optional[ResponsePromptParam] | Omitr   
str | Omitr   ,Optional[Literal['in-memory', '24h']] | Omitr   Optional[Reasoning] | Omitr   r   HOptional[Literal['auto', 'default', 'flex', 'scale', 'priority']] | Omitr   r   zOptional[Literal[False]] | Omitr   5Optional[response_create_params.StreamOptions] | Omitr   Optional[float] | Omitr   ResponseTextConfigParam | Omitr   (response_create_params.ToolChoice | Omitr   Iterable[ToolParam] | Omitr   r   r   ,Optional[Literal['auto', 'disabled']] | Omitr   r   Headers | Noner   Query | Noner   Body | Noner   'float | httpx.Timeout | None | NotGivenr`   rC   ra   )rb   s   "rc   rd   re   q       v v *v `	v
 Kv ;v 5v +v 0v -v ,v %v 3v 3v 5v  %!v" !M#v$ .%v& &'v( _)v* %+v, 0-v. N/v0 ,1v2 -3v4 >5v6 *7v8 +9v: &;v< A=v> ?vD &EvF "GvH  IvJ 9KvL 
Mvrf   c       !            R# aK+  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).

  context_management: Context management configuration for this request.

  conversation: The conversation that this response belongs to. Items from this conversation are
      prepended to `input_items` for this response request. Input items and output
      items from this response are automatically added to this conversation after this
      response completes.

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

      - `web_search_call.action.sources`: Include the sources of the web search tool
        call.
      - `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).
      Cannot be used in conjunction with `conversation`.

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

  prompt_cache_key: Used by OpenAI to cache responses for similar requests to optimize your cache
      hit rates. Replaces the `user` field.
      [Learn more](https://platform.openai.com/docs/guides/prompt-caching).

  prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
      prompt caching, which keeps cached prefixes active for longer, up to a maximum
      of 24 hours.
      [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).

  reasoning: **gpt-5 and o-series models only**

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

  safety_identifier: A stable identifier used to help detect users of your application that may be
      violating OpenAI's usage policies. The IDs should be a string that uniquely
      identifies each user, with a maximum length of 64 characters. We recommend
      hashing their username or email address, in order to avoid sending us any
      identifying information.
      [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).

  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 request 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](https://openai.com/api-priority-processing/)', then the request
        will be processed with the corresponding service tier.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the
      `service_tier` value based on the processing mode actually used to serve the
      request. This response value may be different from the value set in the
      parameter.

  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.

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

  temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
      make the output more random, while lower values like 0.2 will make it more
      focused and deterministic. We generally recommend altering this or `top_p` but
      not both.

  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.

      We support the following categories of tools:

      - **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).
      - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
        predefined connectors such as Google Drive and SharePoint. Learn more about
        [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
      - **Function calls (custom tools)**: Functions that are defined by you, enabling
        the model to call your own code with strongly typed arguments and outputs.
        Learn more about
        [function calling](https://platform.openai.com/docs/guides/function-calling).
        You can also use custom tools to call your own code.

  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 input to this Response exceeds the model's context window size,
        the model will truncate the response to fit the context window by dropping
        items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window size
        for a model, the request will fail with a 400 error.

  user: This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
      `prompt_cache_key` instead to maintain caching optimizations. A stable
      identifier for your end-users. Used to boost cache hit rates by better bucketing
      similar requests and to help OpenAI detect and prevent abuse.
      [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).

  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
Nra   "rk   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   createResponses.createp       n 	rf   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   Literal[True]r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   Stream[ResponseStreamEvent]ra   )rb   s   "rc   rd   re   j  s    v v v *	v
 `v Kv ;v 5v +v 0v -v ,v %v 3v 3v  5!v" %#v$ !M%v& .'v( &)v* _+v, %-v. N/v0 ,1v2 -3v4 >5v6 *7v8 +9v: &;v< A=v> ?vD &EvF "GvH  IvJ 9KvL 
%Mvrf   c       !            R# aK+  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).

  context_management: Context management configuration for this request.

  conversation: The conversation that this response belongs to. Items from this conversation are
      prepended to `input_items` for this response request. Input items and output
      items from this response are automatically added to this conversation after this
      response completes.

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

      - `web_search_call.action.sources`: Include the sources of the web search tool
        call.
      - `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).
      Cannot be used in conjunction with `conversation`.

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

  prompt_cache_key: Used by OpenAI to cache responses for similar requests to optimize your cache
      hit rates. Replaces the `user` field.
      [Learn more](https://platform.openai.com/docs/guides/prompt-caching).

  prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
      prompt caching, which keeps cached prefixes active for longer, up to a maximum
      of 24 hours.
      [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).

  reasoning: **gpt-5 and o-series models only**

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

  safety_identifier: A stable identifier used to help detect users of your application that may be
      violating OpenAI's usage policies. The IDs should be a string that uniquely
      identifies each user, with a maximum length of 64 characters. We recommend
      hashing their username or email address, in order to avoid sending us any
      identifying information.
      [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).

  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 request 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](https://openai.com/api-priority-processing/)', then the request
        will be processed with the corresponding service tier.
      - When not set, the default behavior is 'auto'.

      When the `service_tier` parameter is set, the response body will include the
      `service_tier` value based on the processing mode actually used to serve the
      request. This response value may be different from the value set in the
      parameter.

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

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

  temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
      make the output more random, while lower values like 0.2 will make it more
      focused and deterministic. We generally recommend altering this or `top_p` but
      not both.

  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.

      We support the following categories of tools:

      - **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).
      - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
        predefined connectors such as Google Drive and SharePoint. Learn more about
        [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
      - **Function calls (custom tools)**: Functions that are defined by you, enabling
        the model to call your own code with strongly typed arguments and outputs.
        Learn more about
        [function calling](https://platform.openai.com/docs/guides/function-calling).
        You can also use custom tools to call your own code.

  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 input to this Response exceeds the model's context window size,
        the model will truncate the response to fit the context window by dropping
        items from the beginning of the conversation.
      - `disabled` (default): If the input size will exceed the context window size
        for a model, the request will fail with a 400 error.

  user: This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
      `prompt_cache_key` instead to maintain caching optimizations. A stable
      identifier for your end-users. Used to boost cache hit rates by better bucketing
      similar requests and to help OpenAI detect and prevent abuse.
      [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).

  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
Nra   "rk   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r   i  r   rf   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   boolr~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   &Response | Stream[ResponseStreamEvent]ra   )rb   s   "rc   rd   re   c  s    v v v *	v
 `v Kv ;v 5v +v 0v -v ,v %v 3v 3v  5!v" %#v$ !M%v& .'v( &)v* _+v, %-v. N/v0 ,1v2 -3v4 >5v6 *7v8 +9v: &;v< A=v> ?vD &EvF "GvH  IvJ 9KvL 
0Mvrf   c       !            R# r   ra   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r   b  r   rf   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"R#R$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   /Optional[Literal[False]] | Literal[True] | Omitr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re   [  s    S
 S
 *S
 `	S

 KS
 ;S
 5S
 +S
 0S
 -S
 ,S
 %S
 3S
 3S
 5S
  %!S
" !M#S
$ .%S
& &'S
( _)S
* %+S
, @-S
. N/S
0 ,1S
2 -3S
4 >5S
6 *7S
8 +9S
: &;S
< A=S
> ?S
D &ES
F "GS
H  IS
J 9KS
L 
0MS
rf   c       !        	~   T P                  R \        / RVbRVbRVbRVbRVbRVbRVbRVbR	V	bR
V
bRVbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRVRVRV/CV'       d   \        P                  M\        P                  4      \        VVV V!R7      \        T;'       g    R\        \        ,          R 7      # )!
/responsesr~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Fbodyoptionscast_tor   
stream_cls)	_postr    r<   ResponseCreateParamsStreaming ResponseCreateParamsNonStreamingr;   rC   r/   rQ   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r   [  s   N zz  *(*< #L w	
 U #L (): %n  U *+> +,@ f '(8 -.D   !" ():#$ #LUf$n!;D!;U"LU *D;@  'DD+LLE#H )+Q[el ??U12W  ,
 ,	
rf   text_formatstarting_afterc               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r_   response_idstrr   type[TextFormatT] | Omitr   
int | Omitr   #Iterable[ParseableToolParam] | Omitr   r   r   r   r   r   r   r   r`   "ResponseStreamManager[TextFormatT]ra   )rb   s   "rc   rd   re     sf     1 1 1 .	1
 #1 31 &1 "1  1 91 
,1rf   c               	    R # rh   ra   	rk   r   r   r   r   r   r   r   r   s	   &$$$$$$$$rc   r   Responses.stream  s     .1rf   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR R!R"RR#R$R%RR&R'R(R)R*R+R,R-R.RR/R)R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   Union[str, ResponseInputParam]r   rN   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     sp    &1 &1 .&1 	&1
 *&1 `&1 .&1 3&1 K&1 ;&1 +&1 0&1 -&1 ,&1 3&1  3!&1" 5#&1$ %%&1& !M'&1( .)&1* &+&1, _-&1. %/&10 N1&12 ,3&14 -5&16 >7&18 +9&1: &;&1< A=&1> ?&1D &E&1F "G&1H  I&1J 9K&1L 
,M&1rf   c       !        	    R # rh   ra   "rk   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r     s    N .1rf   r   c          H         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!R"R#RR$R%R&RR'R(R)R*R+R,R-R.R/RR0R*R1R2R3RR4R5R6R7R8R9R:R;R<R=R>R?/$# )@r_   r   r   r   r   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     s    W W  W 5	W
 %W *W `W .W 3W KW ;W +W 0W -W ,W  3!W" 3#W$ 5%W& %'W( !M)W* .+W, &-W. _/W0 %1W2 N3W4 ,5W6 -7W8 >9W: +;W< &=W> A?W@ AWB #CWH &IWJ "KWL  MWN 9OWP 
,QWrf   c       #        	  a aa	a a!a"a# / R VbRVbRVbRVbRS	bRV
bRVbRVbRVbR	VbR
VbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRV/
Cp$V$P                  4        U%U&u. uF  w  p%p&\        V&4      '       g   K  V%NK  	  p'p%p&\        S4      '       g   \        V4      '       d2   \        V'4      ^ 8  d"   \        RRP	                  V'4      ,           4      h\        V4      p\        V'4      ^ 8  Ed   \        V4      '       g   \        R4      h\        V4      '       g   \        R4      h\        V4      '       d6   V'       g   / pRV9   d   \        R 4      h\        V4      p\        V4      VR&   \        S P                  3/ R VbRVbR!VbRVbRVbRS	bRV
bRVbRVbRVbR	VbR
VbRVbRVbRVbRVbRVbR"R#bRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbR$S bR%S!bR&S"bR'S#b p(\        V(WgR(R)7      # \        S4      '       g   \        R*4      h\        V"V V!V	VV V#3R+ lTT\        V4      '       d   VR)7      # R(R)7      # u up&p%i ),r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   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 responserb   1Cannot mix and match text.format with text_formatr   r   Tr   r   r   r   Nr   input_toolsr   z7id must be provided when streaming an existing responsec                 R   < SP                  SR S;'       g    . SSS \        SR7      # )T)r   r   r   r   r   r   r   r   )retriever   )r   r   r   r   r   rk   r   s   rc   <lambda>"Responses.stream.<locals>.<lambda>r  s1     +#MMr"/ +)#'# & 	rf   )itemsr   len
ValueErrorjoin_make_tools	TypeErrorr   _type_to_text_format_paramr   r   rI   )rk   r   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   new_response_argskvnew_response_args_namesapi_requests)   fd$$$$$$$d$$$$$$$$$$$$$$$$$$$$$$dddd     rc   r   r     s   R
U
U
 !"4
 L	

 w
 L
  !2
 n
 
 "#6
 #$8
 f
  0
 %&<
 
   !2!
" L#
$ Un;D;LU*D*7
: 2C1H1H1J"Z1JAhWXk111J"Z[!!Xn%=%=3G^C_bcCca))345  E"&'!+E?? !VWWE?? !VWW$$Dt##$WXXDz!;K!HX@G#A#A #A 	#A
 $6#A *#A  #A *#A #4#A  .#A "#A %8#A &:#A #A "2#A  (>!#A" ##A$  .%#A& '#A( ()#A* +#A, (-#A. $/#A0 #41#A2 *3#A4 *5#A6 7#A8 &9#A: ;#A< &=#A> ,?#A@ (A#AB &C#AD  E#AKJ )+quvvK(( !Z[[(	 	 (!19.1I1I~  PT G #[s   &I	I		verbosityc          H         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.R/R0RR1R)R2R3R4RR5R6R7R8R9R:R;R<R=R>R?R@/$# Ar_   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  z1Optional[Literal['low', 'medium', 'high']] | Omitr   r   r   r   r   r   r   r   r`   ParsedResponse[TextFormatT]ra   )rb   s   "rc   rd   re         j
 j
 .j
 *	j

 `j
 Kj
 ;j
 5j
 +j
 0j
 -j
 ,j
 %j
 3j
 3j
  5!j
" %#j
$ !M%j
& .'j
( &)j
* _+j
, %-j
. @/j
0 N1j
2 ,3j
4 -5j
6 >7j
8 39j
: +;j
< &=j
> A?j
@ Aj
B ECj
H &Ij
J "Kj
L  Mj
N 9Oj
P 
%Qj
rf   c       #         	   aa \        S4      '       d6   V'       g   / pR V9   d   \        R4      h\        V4      p\        S4      VR &   \	        S4      oR VV3R llp$V P                  R\        / RVbRVbRVbRVbR	VbR
VbRVbRV	bRV
bRVbRVbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRSRVRVR VR!VR"V/C\        P                  4      \        V V!V"V#V$R#7      \        \        \        \        ,          ,          \        4      R$7      # )%rb   r   c                    V ^8  d   QhRRRR/# r_   raw_responserC   r`   r  ra   )rb   s   "rc   rd   %Responses.parse.<locals>.__annotate__       	 	 	.I 	rf   c                    < \        SSV R 7      # )r   r   responserA   r	  r   r   s   &rc   parserResponses.parse.<locals>.parser      !!'% rf   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   post_parserr   r   r   r   r   r   r   r   r   r    r<   ResponseCreateParamsr;   r   r	   rH   r@   rC   %rk   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r  s%   &d$$$$$$$$$$$$$$$$$$$$$$$$d$$$$$$$$$ rc   parseResponses.parse  s   R K  4 STT:D7DDNE"	 	 zz  *(*< #L w	
 U #L (): %n  U *+> +,@ f '(8 -.D   !" ():#$ #LUf$n!;D!;U"LU *D=@ ';;C"F )+'%" n[9:HE]  /
 /	
rf   include_obfuscationc               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# r_   r   r   r   List[ResponseIncludable] | Omitr  bool | Omitr   r   r   zLiteral[False] | Omitr   r   r   r   r   r   r   r   r`   rC   ra   )rb   s   "rc   rd   re     n       1	
 ) # & & "   9 
rf   c               	    R # rh   ra   
rk   r   r   r  r   r   r   r   r   r   s
   &&$$$$$$$$rc   r   Responses.retrieve  s     rf   c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r_   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     sd     * ** 	*
 1* #* &* "*  * 9* 
%*rf   c               	    R # rh   ra   	rk   r   r   r   r   r   r   r   r   s	   &&$$$$$$$rc   r   r$    s     '*rf   c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# r_   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     sd     5 55 	5
 15 #5 &5 "5  5 95 
05rf   c               	    R # rh   ra   r'  s	   &&$$$$$$$rc   r   r$    s     25rf   Fc               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# r)  ra   )rb   s   "rc   rd   re     sd     - -- 	-
 1- #- &- "-  - 9- 
0-rf   c                   R# 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.

  include_obfuscation: When true, stream obfuscation will be enabled. Stream obfuscation adds random
      characters to an `obfuscation` field on streaming delta events to normalize
      payload sizes as a mitigation to certain side-channel attacks. These obfuscation
      fields are included by default, but add a small amount of overhead to the data
      stream. You can set `include_obfuscation` to false to optimize for bandwidth if
      you trust the network links between your application and the OpenAI API.

  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
Nra   r'  s	   &&$$$$$$$rc   r   r$    s    \ 	rf   c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re   O  sn     . .. 	.
 1. ). #. &. ".  . 9. 
%.rf   c                   R# 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.

  include_obfuscation: When true, stream obfuscation will be enabled. Stream obfuscation adds random
      characters to an `obfuscation` field on streaming delta events to normalize
      payload sizes as a mitigation to certain side-channel attacks. These obfuscation
      fields are included by default, but add a small amount of overhead to the data
      stream. You can set `include_obfuscation` to false to optimize for bandwidth if
      you trust the network links between your application and the OpenAI API.

  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
Nra   
rk   r   r   r   r  r   r   r   r   r   s
   &&$$$$$$$$rc   r   r$  N      ^ 	rf   c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     sn     . .. 	.
 1. ). #. &. ".  . 9. 
0.rf   c                   R# r0  ra   r1  s
   &&$$$$$$$$rc   r   r$    r2  rf   c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r  r  r   r   r   r   %Literal[False] | Literal[True] | Omitr   r   r   r   r   r   r   r   r`   r   ra   )rb   s   "rc   rd   re     sn     %
 %
%
 1	%

 )%
 #%
 6%
 &%
 "%
  %
 9%
 
0%
rf   c               	   V'       g   \        R V: 24      hT P                  \        RVR7      \        VVVV	\	        RVRVRVRV/\
        P                  4      R7      \        T;'       g    R\        \        ,          R	7      # )
:Expected a non-empty value for `response_id` but received /responses/{response_id}r   r   r  r   r   r   r   r   r   queryFr   r   r   r   )
r   _getr   r;   r    r>   ResponseRetrieveParamsrC   r/   rQ   r#  s
   &&$$$$$$$$rc   r   r$    s     YZeYhijjyy4+N(+'%%!7-/B(. &	 -CC ??U12'  
 	
rf   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# r_   r   r   r   r   r   r   r   r   r   r   r`   Nonera   )rb   s   "rc   rd   re     F      
  
 
 & 
 " 
   
 9 
 
 
rf   c          
         V'       g   \        RV: 24      hRR/T;'       g    / CpV P                  \        RVR7      \        W#WER7      \        R7      # )'  
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
r8  Accept*/*r9  r:  r   r   r   r   _deleter   r;   r   rk   r   r   r   r   r   s   &&$$$$rc   deleteResponses.delete  sg    . YZeYhijj!5B]-@-@bB||4+N(+Q[   
 	
rf   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# r_   r   r   r   r   r   r   r   r   r   r   r`   rC   ra   )rb   s   "rc   rd   re     F     "
 "
"
 &"
 ""
  "
 9"
 
"
rf   c          
         V'       g   \        RV: 24      hV P                  \        RVR7      \        W#WER7      \        R7      # )  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
r8  /responses/{response_id}/cancelr:  r   rH  r   r   r   r;   rC   rK  s   &&$$$$rc   cancelResponses.cancel  sP    4 YZeYhijjzz;U(+Q[   
 	
rf   c               @    V ^8  d   QhRRRRRRRRRRR	R
RRRRRRRR/
# r_   r   a  Union[Literal['gpt-5.4', 'gpt-5.4-mini', 'gpt-5.4-nano', 'gpt-5.4-mini-2026-03-17', 'gpt-5.4-nano-2026-03-17', 'gpt-5.3-chat-latest', 'gpt-5.2', 'gpt-5.2-2025-12-11', 'gpt-5.2-chat-latest', 'gpt-5.2-pro', 'gpt-5.2-pro-2025-12-11', 'gpt-5.1', 'gpt-5.1-2025-11-13', 'gpt-5.1-codex', 'gpt-5.1-mini', 'gpt-5.1-chat-latest', 'gpt-5', 'gpt-5-mini', 'gpt-5-nano', 'gpt-5-2025-08-07', 'gpt-5-mini-2025-08-07', 'gpt-5-nano-2025-08-07', 'gpt-5-chat-latest', 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano', 'gpt-4.1-2025-04-14', 'gpt-4.1-mini-2025-04-14', 'gpt-4.1-nano-2025-04-14', 'o4-mini', 'o4-mini-2025-04-16', 'o3', 'o3-2025-04-16', 'o3-mini', 'o3-mini-2025-01-31', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'o1-mini', 'o1-mini-2024-09-12', 'gpt-4o', 'gpt-4o-2024-11-20', 'gpt-4o-2024-08-06', 'gpt-4o-2024-05-13', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-audio-preview-2025-06-03', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'gpt-4o-search-preview', 'gpt-4o-mini-search-preview', 'gpt-4o-search-preview-2025-03-11', 'gpt-4o-mini-search-preview-2025-03-11', 'chatgpt-4o-latest', 'codex-mini-latest', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-0125-preview', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-16k-0613', 'o1-pro', 'o1-pro-2025-03-19', 'o3-pro', 'o3-pro-2025-06-10', 'o3-deep-research', 'o3-deep-research-2025-06-26', 'o4-mini-deep-research', 'o4-mini-deep-research-2025-06-26', 'computer-use-preview', 'computer-use-preview-2025-03-11', 'gpt-5-codex', 'gpt-5-pro', 'gpt-5-pro-2025-10-06', 'gpt-5.1-codex-max'], str, None]r   z9Union[str, Iterable[ResponseInputItemParam], None] | Omitr   r   r   r   r   r   r   r   r   r   r   r   r`   rK   ra   )rb   s   "rc   rd   re          f
 f
a
f
J IKf
L +Mf
N 3Of
P /Qf
V &Wf
X "Yf
Z  [f
\ 9]f
^ 
_f
rf   c       	            V P                  R\        RVRVRVRVRV/\        P                  4      \	        WgWR7      \
        R7      # )	  Compact a conversation.

Returns a compacted response object.

Learn when and how to compact long-running conversations in the
[conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window).
For ZDR-compatible compaction details, see
[Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced).

Args:
  model: Model ID used to generate the response, like `gpt-5` 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.

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

  instructions: A system (or developer) message inserted into the model's context. When used
      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.

  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).
      Cannot be used in conjunction with `conversation`.

  prompt_cache_key: A key to use when reading from or writing to the prompt cache.

  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
/responses/compactr   r   r   r   r   r   r  )r   r    r=   ResponseCompactParamsr;   rK   
rk   r   r   r   r   r   r   r   r   r   s
   &$$$$$$$$$rc   compactResponses.compact  sf    l zz  UU"L*,@&(8 (==	 )+Q[ &  
 	
rf   c               (    V ^8  d   QhRRRRRRRR/# )	r_   r   r   r   r   websocket_connection_optionsrL   r`   ResponsesConnectionManagerra   )rb   s   "rc   rd   re     s3     
 

 
 'A	

 
$
rf   c                4    \        V P                  VVVR7      # zConnect to a persistent Responses API WebSocket.

Send `response.create` events and receive response stream events over the socket.
)clientr   r   rb  )rc  ri   rk   r   r   rb  s   &&&&rc   connectResponses.connect  s!     *<<#')E	
 	
rf   ra   __name__
__module____qualname____firstlineno__r#   rl   rp   rv   r|   r   r   r   r   r   r   r  r   rL  rU  r_  rh  __static_attributes__ra   rf   rc   rZ   rZ   T   s   ( ( ) ) . . 4 4 v -1v cg	v
 NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v 8<v  (,!v" PT#v$ 15%v& )-'v( bf)v* (,+v, 37-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vp v -1	v
 cgv NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v  8<!v" (,#v$ PT%v& 15'v( )-)v* bf+v, (,-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vp v -1	v
 cgv NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v  8<!v" (,#v$ PT%v& 15'v( )-)v* bf+v, (,-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vpS
 -1S
 cg	S

 NRS
 >BS
 8<S
 .2S
 37S
 04S
 /3S
 (,S
 6:S
 6:S
 8<S
  (,!S
" PT#S
$ 15%S
& )-'S
( bf)S
* (,+S
, CG-S
. QU/S
0 /31S
2 043S
4 AE5S
6 -17S
8 .29S
: )-;S
< DH=S
>  ?S
D )-ES
F %)GS
H #'IS
J <EKS
j 1 15	1
 &*1 6:1 )-1 %)1 #'1 <E1 1 &1
 -1&1 cg&1 15&1 6:&1 NR&1 >B&1 .2&1 37&1 04&1 /3&1 6:&1  6:!&1" 8<#&1$ (,%&1& PT'&1( 15)&1* )-+&1, bf-&1. (,/&10 QU1&12 /33&14 045&16 AE7&18 .29&1: )-;&1< DH=&1>  ?&1D )-E&1F %)G&1H #'I&1J <EK&1 &1PW #'W 8<	W
 (,W -1W cgW 15W 6:W NRW >BW .2W 37W 04W /3W  6:!W" 6:#W$ 8<%W& (,'W( PT)W* 15+W, )--W. bf/W0 (,1W2 QU3W4 /35W6 047W8 AE9W: .2;W< )-=W> DH?W@  AWB &*CWH )-IWJ %)KWL #'MWN <EOWrj
 15j
 -1	j

 cgj
 NRj
 >Bj
 8<j
 .2j
 37j
 04j
 /3j
 (,j
 6:j
 6:j
  8<!j
" (,#j
$ PT%j
& 15'j
( )-)j
* bf+j
, (,-j
. CG/j
0 QU1j
2 /33j
4 045j
6 AE7j
8 6:9j
: .2;j
< )-=j
> DH?j
@  Aj
B HLCj
H )-Ij
J %)Kj
L #'Mj
N <EOj
X  48	
 ,0 &* )- )- %) #' <E   *
 48* &** )-* %)* #'* <E* * 5
 485 &*5 )-5 %)5 #'5 <E5 5 - 	-
 48- &*- )-- %)- #'- <E- -^ .
 48. ,0. &*. )-. %). #'. <E. .` .
 48. ,0. &*. )-. %). #'. <E. .`%
 48	%

 ,0%
 &*%
 9=%
 )-%
 %)%
 #'%
 <E%
N 
 )- 
 %) 
 #' 
 <E 
D"
 )-"
 %)"
 #'"
 <E"
Hf
J LPKf
L .2Mf
N 6:Of
P 26Qf
V )-Wf
X %)Yf
Z #'[f
\ <E]f
T  !#CE	
 
rf   c            F         ] tR tRt]R R l4       t]R R l4       t]R R l4       t]R R	 l4       t]	R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&]
R'R(R)R(R*R(R+]/!R, R- ll4       t]	R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&]
R'R(R)R(R*R(R+]/ R. R/ ll4       t]	R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&]
R'R(R)R(R*R(R+]/ R0 R1 ll4       tR
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&]
R'R(R)R(R*R(R+]/!R2 R3 llt]	R4]
R5]
R"]
R'R(R)R(R*R(R+]/R6 R7 ll4       t]	R
]
R]
R4]
R"]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R#]
R$]
R%]
R&]
R'R(R)R(R*R(R+]/R8 R9 ll4       tR:]
R]
R]
R
]
R]
R4]
R"]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R#]
R$]
R%]
R&]
R5]
R'R(R)R(R*R(R+]/#R; R< lltR4]
R
]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R]
R ]
R!]
R"]
R#]
R$]
R%]
R&]
R=]
R'R(R)R(R*R(R+]/#R> R? llt]	R]
R@]
R5]
R]
R'R(R)R(R*R(R+]/RA RB ll4       t]	R]
R5]
R'R(R)R(R*R(R+]/RC RD ll4       t]	R]
R5]
R'R(R)R(R*R(R+]/RE RF ll4       t]	RRGR]
R5]
R'R(R)R(R*R(R+]/RH RI ll4       t]	R]
R@]
R5]
R'R(R)R(R*R(R+]/RJ RK ll4       t]	R]
R@]
R5]
R'R(R)R(R*R(R+]/RL RM ll4       tR]
R@]
R5]
R]
R'R(R)R(R*R(R+]/RN RO lltR'R(R)R(R*R(R+]/RP RQ lltR'R(R)R(R*R(R+]/RR RS lltR]
R]
R]
R]
R'R(R)R(R*R(R+]/RT RU llt/ / / 3RV RW lltRXtR(# )Yr[   i  c                   V ^8  d   QhRR/# )r_   r`   r*   ra   )rb   s   "rc   rd   AsyncResponses.__annotate__  s     - -_ -rf   c                	,    \        V P                  4      # rh   )r*   ri   rj   s   &rc   rl   AsyncResponses.input_items  s    t||,,rf   c                   V ^8  d   QhRR/# )r_   r`   r4   ra   )rb   s   "rc   rd   rr    s     . .. .rf   c                	,    \        V P                  4      # rh   )r4   ri   rj   s   &rc   rp   AsyncResponses.input_tokens  s    --rf   c                   V ^8  d   QhRR/# )r_   r`   AsyncResponsesWithRawResponsera   )rb   s   "rc   rd   rr    s     3 3#@ 3rf   c                    \        V 4      # ru   )ry  rj   s   &rc   rv    AsyncResponses.with_raw_response  s     -T22rf   c                   V ^8  d   QhRR/# )r_   r`   #AsyncResponsesWithStreamingResponsera   )rb   s   "rc   rd   rr    s     9 9)L 9rf   c                    \        V 4      # r{   )r}  rj   s   &rc   r|   &AsyncResponses.with_streaming_response  s     3488rf   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Nr   r   r   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"R#R$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# r   ra   )rb   s   "rc   rd   rr    r   rf   c       !           "   R# 5ir   ra   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   AsyncResponses.create       n 	   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`    AsyncStream[ResponseStreamEvent]ra   )rb   s   "rc   rd   rr    s    v v v *	v
 `v Kv ;v 5v +v 0v -v ,v %v 3v 3v  5!v" %#v$ !M%v& .'v( &)v* _+v, %-v. N/v0 ,1v2 -3v4 >5v6 *7v8 +9v: &;v< A=v> ?vD &EvF "GvH  IvJ 9KvL 
*Mvrf   c       !           "   R# 5ir   ra   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r    r  r  c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   +Response | AsyncStream[ResponseStreamEvent]ra   )rb   s   "rc   rd   rr    s    v v v *	v
 `v Kv ;v 5v +v 0v -v ,v %v 3v 3v  5!v" %#v$ !M%v& .'v( &)v* _+v, %-v. N/v0 ,1v2 -3v4 >5v6 *7v8 +9v: &;v< A=v> ?vD &EvF "GvH  IvJ 9KvL 
5Mvrf   c       !           "   R# 5ir   ra   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r    r  r  c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"R#R$R%R&R'R(R)R*R+R,R-R.RR/R'R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr  	  s    S
 S
 *S
 `	S

 KS
 ;S
 5S
 +S
 0S
 -S
 ,S
 %S
 3S
 3S
 5S
  %!S
" !M#S
$ .%S
& &'S
( _)S
* %+S
, @-S
. N/S
0 ,1S
2 -3S
4 >5S
6 *7S
8 +9S
: &;S
< A=S
> ?S
D &ES
F "GS
H  IS
J 9KS
L 
5MS
rf   c       !        	  "   T P                  R \        / RVbRVbRVbRVbRVbRVbRVbRVbR	V	bR
V
bRVbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRVRVRV/CV'       d   \        P                  M\        P                  4      G Rj  xL
 \        VVV V!R7      \        T;'       g    R \        \        ,          R!7      G Rj  xL
 #  L? L5i)"r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Nr   Fr   )	r   r"   r<   r   r   r;   rC   r0   rQ   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r  	  s    N ZZ, *(*< #L w	
 U #L (): %n  U *+> +,@ f '(8 -.D   !" ():#$ #LUf$n!;D!;U"LU *D;@  'DD+LLE# #H )+Q[el ??U"#67W   ,
 ,
 ,	
#,
s*   BCC
C1CCCCr   r   c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r_   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   'AsyncResponseStreamManager[TextFormatT]ra   )rb   s   "rc   rd   rr  4
  sf     6 6 6 .	6
 #6 36 &6 "6  6 96 
16rf   c               	    R # rh   ra   r   s	   &$$$$$$$$rc   r   AsyncResponses.stream3
  s     36rf   c          D         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR R!R"RR#R$R%RR&R'R(R)R*R+R,R-R.RR/R)R0R1R2RR3R4R5R6R7R8R9R:R;R</"# )=r_   r   r   r   rN   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr  C
  sp    &6 &6 .&6 	&6
 *&6 `&6 .&6 3&6 K&6 ;&6 +&6 0&6 -&6 ,&6 3&6  3!&6" 5#&6$ %%&6& !M'&6( .)&6* &+&6, _-&6. %/&60 N1&62 ,3&64 -5&66 >7&68 +9&6: &;&6< A=&6> ?&6D &E&6F "G&6H  I&6J 9K&6L 
1M&6rf   c       !        	    R # rh   ra   r   s"   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   r  B
  s    N 36rf   r   c          H         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!R"R#RR$R%R&RR'R(R)R*R+R,R-R.R/RR0R*R1R2R3RR4R5R6R7R8R9R:R;R<R=R>R?/$# )@r_   r   r   r   r   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr  k
  s    [ [  [ 5	[
 %[ *[ `[ .[ 3[ K[ ;[ +[ 0[ -[ ,[  3![" 3#[$ 5%[& %'[( !M)[* .+[, &-[. _/[0 %1[2 N3[4 ,5[6 -7[8 >9[: +;[< &=[> A?[@ A[B #C[H &I[J "K[L  M[N 9O[P 
1Q[rf   c       #        	   / R VbRVbRVbRVbRV	bRV
bRVbRVbRVbR	VbR
VbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRV/
Cp$V$P                  4        U%U&u. uF  w  p%p&\        V&4      '       g   K  V%NK  	  p'p%p&\        V4      '       g   \        V4      '       d2   \        V'4      ^ 8  d"   \        RRP	                  V'4      ,           4      h\        V4      p\        V'4      ^ 8  Ed   \        V\        4      '       d   \        R4      h\        V4      '       g   \        R4      h\        V4      '       d6   V'       g   / pRV9   d   \        R 4      h\        V4      p\        V4      VR&   V P                  ! R,/ R VbRVbR!R"bR#VbRVbRVbRV	bRV
bRVbRVbRVbR	VbR
VbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbRVbR$V bR%V!bR&V"bR'V#b p(\        V(VVR(R)7      # \        V\        4      '       d   \        R*4      hT P                  TR"T	;'       g    . V V!V"V#R+7      p(\        T(TT\        V4      '       d   VR)7      # R(R)7      # u up&p%i )-r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r~   r   r   r   r   rb   r   r   Tr   r   r   r   r   Nr   z@response_id must be provided when streaming an existing response)r   r   r   r   r   r   ra   )r   r   r   r   r   r   
isinstancer   r   r   r   r   rJ   r   r   r   s)   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$     rc   r   r  k
  s   R
U
U
 !"4
 L	

 w
 L
  !2
 n
 
 "#6
 #$8
 f
  0
 %&<
 
   !2!
" L#
$ Un;D;LU*D*7
: 2C1H1H1J"Z1JAhWXk111J"Z[!!Xn%=%=3G^C_bcCca))345 
 E"&'!+%** !VWWE?? !VWW$$Dt##$WXXDz!;K!HX++ """ " 	"
 $6" *"  " *" #4"  ." "" %8" &:" " "2"  (>!"" #"$  .%"& ('"( )"* (+", $-". #4/"0 *1"2 *3"4 5"6 &7"8 9": &;"< ,="> (?"@ &A"B  C"KH .'!#	  +t,, !cdd--2+'% ( K .'!19.1I1I~	  PT	 a #[s   I!:I!r  c          H         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRR RR!R"R#RR$R%R&R'R(R)R*R+R,R-R.R/R0RR1R)R2R3R4RR5R6R7R8R9R:R;R<R=R>R?R@/$# r  ra   )rb   s   "rc   rd   rr    r  rf   c       #         	<  aa"   \        S4      '       d6   V'       g   / pR V9   d   \        R4      h\        V4      p\        S4      VR &   \	        S4      oR VV3R llp$V P                  R\        / RVbRVbRVbRVbR	VbR
VbRVbRV	bRV
bRVbRVbRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRSRVRVR VR!VR"V/C\        P                  4      \        V V!V"V#V$R#7      \        \        \        \        ,          ,          \        4      R$7      G R%j  xL
 #  L5i)&rb   r   c                    V ^8  d   QhRRRR/# r  ra   )rb   s   "rc   rd   *AsyncResponses.parse.<locals>.__annotate__<  r  rf   c                    < \        SSV R 7      # r  r  r  s   &rc   r  $AsyncResponses.parse.<locals>.parser<  r  rf   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  Nr  r  s%   &d$$$$$$$$$$$$$$$$$$$$$$$$d$$$$$$$$$ rc   r  AsyncResponses.parse  s    R K  4 STT:D7DDNE"	 	 ZZ  *(*< #L w	
 U #L (): %n  U *+> +,@ f '(8 -.D   !" ():#$ #LUf$n!;D!;U"LU *D=@ ';;C"F )+'%" n[9:HE]   /
 /
 /	
 /
s   DC7DDDr  c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# r  ra   )rb   s   "rc   rd   rr  u  r!  rf   c               	   "   R # 5irh   ra   r#  s
   &&$$$$$$$$rc   r   AsyncResponses.retrievet  s
      r  c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# )r_   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr    sd     / // 	/
 1/ #/ &/ "/  / 9/ 
*/rf   c               	   "   R # 5irh   ra   r'  s	   &&$$$$$$$rc   r   r    s
      ,/r  c               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# r_   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr    sd     : :: 	:
 1: #: &: ":  : 9: 
5:rf   c               	   "   R # 5irh   ra   r'  s	   &&$$$$$$$rc   r   r    s
      7:r  Fc               <    V ^8  d   QhRRRRRRRRR	R
RRRRRRRR/	# r  ra   )rb   s   "rc   rd   rr    sd     - -- 	-
 1- #- &- "-  - 9- 
5-rf   c                  "   R# 5ir-  ra   r'  s	   &&$$$$$$$rc   r   r    s     \ 	r  c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr    sn     . .. 	.
 1. ). #. &. ".  . 9. 
*.rf   c                  "   R# 5ir0  ra   r1  s
   &&$$$$$$$$rc   r   r         ^ 	r  c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r   r   r  r  r   r   r   r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr    sn     . .. 	.
 1. ). #. &. ".  . 9. 
5.rf   c                  "   R# 5ir0  ra   r1  s
   &&$$$$$$$$rc   r   r    r  r  c               @    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRR/
# )r_   r   r   r   r  r  r   r   r   r   r6  r   r   r   r   r   r   r   r   r`   r  ra   )rb   s   "rc   rd   rr  7  sn     %
 %
%
 1	%

 )%
 #%
 6%
 &%
 "%
  %
 9%
 
5%
rf   c               	8  "   V'       g   \        R V: 24      hT P                  \        RVR7      \        TTTT	\	        RVRVRVRV/\
        P                  4      G Rj  xL
 R7      \        T;'       g    R	\        \        ,          R
7      G Rj  xL
 #  L6 L5i)r8  r9  r:  r   r  r   r   Nr;  Fr=  )
r   r>  r   r;   r"   r>   r?  rC   r0   rQ   r#  s
   &&$$$$$$$$rc   r   r  7  s      YZeYhijjYY4+N(+'%1!7-/B(. &	 -CC  ??U"#67'  
 
 	

s*   ABB B6BBBBc               0    V ^8  d   QhRRRRRRRRR	R
RR/# rA  ra   )rb   s   "rc   rd   rr  ^  rC  rf   c          
        "   V'       g   \        RV: 24      hRR/T;'       g    / CpV P                  \        RVR7      \        W#WER7      \        R7      G Rj  xL
 #  L5i)	rE  r8  rF  rG  r9  r:  r   rH  NrI  rK  s   &&$$$$rc   rL  AsyncResponses.delete^  st     . YZeYhijj!5B]-@-@bB\\4+N(+Q[  " 
 
 	
 
s   #A"5A"A A"c               0    V ^8  d   QhRRRRRRRRR	R
RR/# rO  ra   )rb   s   "rc   rd   rr    rP  rf   c          
        "   V'       g   \        RV: 24      hV P                  \        RVR7      \        W#WER7      \        R7      G Rj  xL
 #  L5i)rR  r8  rS  r:  r   rH  NrT  rK  s   &&$$$$rc   rU  AsyncResponses.cancel  s]     4 YZeYhijjZZ;U(+Q[    
 
 	
 
s   A	AAAc               @    V ^8  d   QhRRRRRRRRRRR	R
RRRRRRRR/
# rX  ra   )rb   s   "rc   rd   rr    rY  rf   c       	           "   T P                  R\        RVRVRVRVRV/\        P                  4      G Rj  xL
 \	        WgWR7      \
        R	7      G Rj  xL
 #  L" L5i)
r[  r\  r   r   r   r   r   Nr   r  )r   r"   r=   r]  r;   rK   r^  s
   &$$$$$$$$$rc   r_  AsyncResponses.compact  s}     l ZZ ,UU"L*,@&(8 (==	 	 )+Q[ &   
 
 	
	
s!   4AA
AAAAc               (    V ^8  d   QhRRRRRRRR/# )	r_   r   r   r   r   rb  rL   r`   AsyncResponsesConnectionManagerra   )rb   s   "rc   rd   rr  L  s3     
 

 
 'A	

 
)
rf   c                4    \        V P                  VVVR7      # re  )r  ri   rg  s   &&&&rc   rh  AsyncResponses.connectL  s!     /<<#')E	
 	
rf   ra   rj  ra   rf   rc   r[   r[     s   - - . . 3 3 9 9 v -1v cg	v
 NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v 8<v  (,!v" PT#v$ 15%v& )-'v( bf)v* (,+v, 37-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vp v -1	v
 cgv NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v  8<!v" (,#v$ PT%v& 15'v( )-)v* bf+v, (,-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vp v -1	v
 cgv NRv >Bv 8<v .2v 37v 04v /3v (,v 6:v 6:v  8<!v" (,#v$ PT%v& 15'v( )-)v* bf+v, (,-v. QU/v0 /31v2 043v4 AE5v6 -17v8 .29v: )-;v< DH=v>  ?vD )-EvF %)GvH #'IvJ <EKv vpS
 -1S
 cg	S

 NRS
 >BS
 8<S
 .2S
 37S
 04S
 /3S
 (,S
 6:S
 6:S
 8<S
  (,!S
" PT#S
$ 15%S
& )-'S
( bf)S
* (,+S
, CG-S
. QU/S
0 /31S
2 043S
4 AE5S
6 -17S
8 .29S
: )-;S
< DH=S
>  ?S
D )-ES
F %)GS
H #'IS
J <EKS
j 6 15	6
 &*6 6:6 )-6 %)6 #'6 <E6 6 &6
 -1&6 cg&6 15&6 6:&6 NR&6 >B&6 .2&6 37&6 04&6 /3&6 6:&6  6:!&6" 8<#&6$ (,%&6& PT'&6( 15)&6* )-+&6, bf-&6. (,/&60 QU1&62 /33&64 045&66 AE7&68 .29&6: )-;&6< DH=&6>  ?&6D )-E&6F %)G&6H #'I&6J <EK&6 &6P[ #'[ 8<	[
 (,[ -1[ cg[ 15[ 6:[ NR[ >B[ .2[ 37[ 04[ /3[  6:![" 6:#[$ 8<%[& (,'[( PT)[* 15+[, )--[. bf/[0 (,1[2 QU3[4 /35[6 047[8 AE9[: .2;[< )-=[> DH?[@  A[B &*C[H )-I[J %)K[L #'M[N <EO[zj
 15j
 -1	j

 cgj
 NRj
 >Bj
 8<j
 .2j
 37j
 04j
 /3j
 (,j
 6:j
 6:j
  8<!j
" (,#j
$ PT%j
& 15'j
( )-)j
* bf+j
, (,-j
. CG/j
0 QU1j
2 /33j
4 045j
6 AE7j
8 6:9j
: .2;j
< )-=j
> DH?j
@  Aj
B HLCj
H )-Ij
J %)Kj
L #'Mj
N <EOj
X  48	
 ,0 &* )- )- %) #' <E   /
 48/ &*/ )-/ %)/ #'/ <E/ / :
 48: &*: )-: %): #': <E: : - 	-
 48- &*- )-- %)- #'- <E- -^ .
 48. ,0. &*. )-. %). #'. <E. .` .
 48. ,0. &*. )-. %). #'. <E. .`%
 48	%

 ,0%
 &*%
 9=%
 )-%
 %)%
 #'%
 <E%
N 
 )- 
 %) 
 #' 
 <E 
D"
 )-"
 %)"
 #'"
 <E"
Hf
J LPKf
L .2Mf
N 6:Of
P 26Qf
V )-Wf
X %)Yf
Z #'[f
\ <E]f
T  !#CE	
 
rf   c                  N    ] tR tRtR R lt]R R l4       t]R R l4       tRtR	# )
rs   i^  c                    V ^8  d   QhRRRR/# r_   	responsesrZ   r`   rB  ra   )rb   s   "rc   rd   %ResponsesWithRawResponse.__annotate___  s     
 
) 
 
rf   c                	   Wn         \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP
                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        R # rh   )	
_responsesr   to_raw_response_wrapperr   r   rL  rU  r_  r  rk   r  s   &&rc   __init__!ResponsesWithRawResponse.__init___  s    #&>>
 )@@
 '>>
 '>>
 (??
 &==OO

rf   c                   V ^8  d   QhRR/# )r_   r`   r+   ra   )rb   s   "rc   rd   r  v  s     F F6 Frf   c                	@    \        V P                  P                  4      # rh   )r+   r  rl   rj   s   &rc   rl   $ResponsesWithRawResponse.input_itemsu  s    ()D)DEErf   c                   V ^8  d   QhRR/# )r_   r`   r5   ra   )rb   s   "rc   rd   r  z  s     H H8 Hrf   c                	@    \        V P                  P                  4      # rh   )r5   r  rp   rj   s   &rc   rp   %ResponsesWithRawResponse.input_tokensy  s    )$//*F*FGGrf   r  rU  r_  r   rL  r  r   N	rk  rl  rm  rn  r  r#   rl   rp   ro  ra   rf   rc   rs   rs   ^  s3    
, F F H Hrf   rs   c                  N    ] tR tRtR R lt]R R l4       t]R R l4       tRtR	# )
ry  i~  c                    V ^8  d   QhRRRR/# r_   r  r[   r`   rB  ra   )rb   s   "rc   rd   *AsyncResponsesWithRawResponse.__annotate__  s     
 
. 
T 
rf   c                	   Wn         \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP
                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        \        P                  ! VP                  4      V n        R # rh   )	r  r   async_to_raw_response_wrapperr   r   rL  rU  r_  r  r  s   &&rc   r  &AsyncResponsesWithRawResponse.__init__  s    #&DD
 )FF
 'DD
 'DD
 (EE
 &CCOO

rf   c                   V ^8  d   QhRR/# )r_   r`   r,   ra   )rb   s   "rc   rd   r    s     K K; Krf   c                	@    \        V P                  P                  4      # rh   )r,   r  rl   rj   s   &rc   rl   )AsyncResponsesWithRawResponse.input_items  s    -doo.I.IJJrf   c                   V ^8  d   QhRR/# )r_   r`   r6   ra   )rb   s   "rc   rd   r    s     M M= Mrf   c                	@    \        V P                  P                  4      # rh   )r6   r  rp   rj   s   &rc   rp   *AsyncResponsesWithRawResponse.input_tokens  s    .t/K/KLLrf   r  Nr  ra   rf   rc   ry  ry  ~  s3    
, K K M Mrf   ry  c                  N    ] tR tRtR R lt]R R l4       t]R R l4       tRtR	# )
ry   i  c                    V ^8  d   QhRRRR/# r  ra   )rb   s   "rc   rd   +ResponsesWithStreamingResponse.__annotate__  s     
 
) 
 
rf   c                	   Wn         \        VP                  4      V n        \        VP                  4      V n        \        VP                  4      V n        \        VP
                  4      V n        \        VP                  4      V n        R # rh   )r  r'   r   r   rL  rU  r_  r  s   &&rc   r  'ResponsesWithStreamingResponse.__init__  sx    #2
 5
 3
 3
 4
rf   c                   V ^8  d   QhRR/# )r_   r`   r-   ra   )rb   s   "rc   rd   r    s     L L< Lrf   c                	@    \        V P                  P                  4      # rh   )r-   r  rl   rj   s   &rc   rl   *ResponsesWithStreamingResponse.input_items  s    .t/J/JKKrf   c                   V ^8  d   QhRR/# )r_   r`   r7   ra   )rb   s   "rc   rd   r    s     N N> Nrf   c                	@    \        V P                  P                  4      # rh   )r7   r  rp   rj   s   &rc   rp   +ResponsesWithStreamingResponse.input_tokens  s    /0L0LMMrf   r  rU  r_  r   rL  r   Nr  ra   rf   rc   ry   ry     s3    
& L L N Nrf   ry   c                  N    ] tR tRtR R lt]R R l4       t]R R l4       tRtR	# )
r}  i  c                    V ^8  d   QhRRRR/# r  ra   )rb   s   "rc   rd   0AsyncResponsesWithStreamingResponse.__annotate__  s     
 
. 
T 
rf   c                	   Wn         \        VP                  4      V n        \        VP                  4      V n        \        VP                  4      V n        \        VP
                  4      V n        \        VP                  4      V n        R # rh   )r  r(   r   r   rL  rU  r_  r  s   &&rc   r  ,AsyncResponsesWithStreamingResponse.__init__  sx    #8
 ;
 9
 9
 :
rf   c                   V ^8  d   QhRR/# )r_   r`   r.   ra   )rb   s   "rc   rd   r    s     Q QA Qrf   c                	@    \        V P                  P                  4      # rh   )r.   r  rl   rj   s   &rc   rl   /AsyncResponsesWithStreamingResponse.input_items  s    3DOO4O4OPPrf   c                   V ^8  d   QhRR/# )r_   r`   r8   ra   )rb   s   "rc   rd   r    s     S SC Srf   c                	@    \        V P                  P                  4      # rh   )r8   r  rp   rj   s   &rc   rp   0AsyncResponsesWithStreamingResponse.input_tokens  s    4T__5Q5QRRrf   r  Nr  ra   rf   rc   r}  r}    s3    
& Q Q S Srf   r}  c                    V ^8  d   QhRRRR/# )r_   r   r   r`   zList[ToolParam] | Omitra   )rb   s   "rc   rd   rd     s     # #: #?U #rf   c                ,   \        V 4      '       g   \        # . pV  F  pVR ,          R8w  d   VP                  V4       K$  RV9  d   VP                  V4       K>  \        \        V4      R,          p\        V\        4      '       g   \        R4      hRV9   g   Q h\        R RRVR,          RVP                  R4      RVR,          RVP                  R4      ;'       g    R/VP                  4      pVP                  VP                  4       4       K  	  V# )typefunctionzcExpected Chat Completions function tool shape to be created using `openai.pydantic_function_tool()`
parametersnamedescriptionstrictF)r   r   appendr   r   r  r1   	Exceptionr2   getr   )r   converted_toolstoolr  new_tools   &    rc   r   r     s   E??')O<:%""4(T!""4(T?:.($899u  x'''0
(x||M:h|4(,,x099E NN	
 	x}}/9 < rf   c                      ] tR tRt$ RtR]R&   R]R&   R R ltR	 R
 ltR R ltR R lt	R R lt
RRRR/R R lltR R ltRtR# )AsyncResponsesConnectioni  ;Represents a live WebSocket connection to the Responses APIAsyncResponsesResponseResourcer  AsyncWebSocketConnection_connectionc                    V ^8  d   QhRRRR/# )r_   
connectionr  r`   rB  ra   )rb   s   "rc   rd   %AsyncResponsesConnection.__annotate__  s     = =#; = =rf   c                	2    Wn         \        V 4      V n        R # rh   )r  r  r  rk   r  s   &&rc   r  !AsyncResponsesConnection.__init__  s    %6t<rf   c                   V ^8  d   QhRR/# )r_   r`   z#AsyncIterator[ResponsesServerEvent]ra   )rb   s   "rc   rd   r  
  s      !D rf   c               t   "   ^ RI Hp   V P                  4       G Rj  xL
 5x  K   L	  T d     R# i ; i5izY
An infinite-iterator that will continue to yield events until
the connection is closed.
)ConnectionClosedOKNwebsockets.exceptionsr  recvrk   r  s   & rc   	__aiter__"AsyncResponsesConnection.__aiter__
  s5     
 	=	 IIK'''! 		s    8* (
* 5858c                   V ^8  d   QhRR/# r_   r`   rS   ra   )rb   s   "rc   rd   r    s     9 90 9rf   c                \   "   T P                  V P                  4       G Rj  xL
 4      #  L5i)
Receive the next message from the connection and parses it into a `ResponsesServerEvent` object.

Canceling this method is safe. There's no risk of losing data.
Nparse_event
recv_bytesrj   s   &rc   r  AsyncResponsesConnection.recv  s%      doo&7 788 7s   ,*	,c                   V ^8  d   QhRR/# r_   r`   bytesra   )rb   s   "rc   rd   r    s     
 
% 
rf   c                   "   V P                   P                  RR7      G Rj  xL
 p\        P                  RV4       V#  L5i)Receive the next message from the connection as raw bytes.

Canceling this method is safe. There's no risk of losing data.

If you want to parse the message into a `ResponsesServerEvent` object like `.recv()` does,
then you can call `.parse_event(data)`.
FdecodeNReceived WebSocket message: %sr  r  r\   debugrk   messages   & rc   r  #AsyncResponsesConnection.recv_bytes  s<      ((--U-;;		2W= <s    A?Ac                    V ^8  d   QhRRRR/# r_   eventz0ResponsesClientEvent | ResponsesClientEventParamr`   rB  ra   )rb   s   "rc   rd   r  +  s     * * P *UY *rf   c                	  "   \        V\        4      '       d   VP                  R R R R7      M+\        P                  ! \        V\        4      G Rj  xL
 4      pV P                  P                  V4      G Rj  xL
  R#  L- L5iT)use_api_namesexclude_defaultsexclude_unsetN)	r  r   to_jsonjsondumpsr"   rV   r  sendrk   r-  datas   && rc   r6  AsyncResponsesConnection.send+  sk      %++ MMtSWMX"7?X"YYZ 	
 ##D))) Z)s$   ABA>&B7B 8B Bcode  reason c               $    V ^8  d   QhRRRRRR/# r_   r:  intr<  r   r`   rB  ra   )rb   s   "rc   rd   r  3  s!     ? ?3 ?s ?D ?rf   c               	Z   "   V P                   P                  WR 7      G Rj  xL
  R#  L5i)r:  r<  Nr  closerk   r:  r<  s   &$$rc   rD  AsyncResponsesConnection.close3  s"     $$$$>>>s    +)+c                    V ^8  d   QhRRRR/# r_   r8  zstr | bytesr`   rS   ra   )rb   s   "rc   rd   r  6       	
 	
 	
0D 	
rf   c           
         \        \        \        \        P                  ! V4      \        \
        \        4      R7      4      # z
Converts a raw `str` or `bytes` message into a `ResponsesServerEvent` object.

This is helpful if you're using `.recv_bytes()`.
)valuetype_r   rS   r$   r4  loadsr   rk   r8  s   &&rc   r  $AsyncResponsesConnection.parse_event6  /      $4::d+;4MaCbc
 	
rf   r  r  N)rk  rl  rm  rn  __doc____annotations__r  r  r  r  r6  rD  r  ro  ra   rf   rc   r  r    sG    E,,))=
9
*? ?R ?	
 	
rf   r  c                  N    ] tR tRtRtR R ltR R lt]tR R ltR	 R
 lt	Rt
R# )r  iB  a  
Context manager over a `AsyncResponsesConnection` that is returned by `responses.connect()`

This context manager ensures that the connection will be closed when it exits.

---

Note that if your application doesn't work well with the context manager approach then you
can call the `.enter()` method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = await client.responses.connect(...).enter()
# ...
await connection.close()
```
c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r_   rf  rY   r   r   r   r   rb  rL   r`   rB  ra   )rb   s   "rc   rd   ,AsyncResponsesConnectionManager.__annotate__V  sF     K K K 	K
 K 'AK 
Krf   c               	D    Wn         R V n        W n        W0n        W@n        R # rh   )(_AsyncResponsesConnectionManager__client,_AsyncResponsesConnectionManager__connection-_AsyncResponsesConnectionManager__extra_query/_AsyncResponsesConnectionManager__extra_headers>_AsyncResponsesConnectionManager__websocket_connection_optionsrk   rf  r   r   rb  s   &$$$$rc   r  (AsyncResponsesConnectionManager.__init__V  s#     =A(,.J+rf   c                   V ^8  d   QhRR/# )r_   r`   r  ra   )rb   s   "rc   rd   rX  d  s     *! *!": *!rf   c                  "    ^ RI Hp T P	                  4       P                  / T P                  P                  P                  CT P                  CR7      p\        P                  RT4       T P                  '       d!   \        P                  RT P                  4       \        T! \        T4      3RT P                  P                  R\!        / T P                  P"                  CT P$                  4      /T P                  B G Rj  xL
 4      T n        T P&                  #   \         d   p\        R4      ThRp?ii ; i L85i)	u;  
👋 If your application doesn't work well with the context manager approach then you
can call this method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = await client.responses.connect(...).enter()
# ...
await connection.close()
```
rh  9You need to install `openai[realtime]` to use this methodNparamsConnecting to %sConnection options: %suser_agent_headeradditional_headers)websockets.asyncio.clientrh  ImportErrorr9   _prepare_url	copy_withrZ  base_urlrf  r\  r\   r'  r^  r  r   
user_agentr:   auth_headersr]  r[  rk   rh  excurls   &   rc   
__aenter__*AsyncResponsesConnectionManager.__aenter__d  s5    	d9 !++--((//$$ , 
 			$c*...II.0S0ST4C
"&--":":
 $3--44 ((	$
 55
 

    7  	dYZ`cc	d
s;   D?D A3D?>BD?D=D?D:)D55D::D?c                   V ^8  d   QhRR/# r_   r`   z	httpx.URLra   )rb   s   "rc   rd   rX         	; 	;i 	;rf   c                	   V P                   P                  e,   \        P                  ! V P                   P                  4      pMQV P                   P                  P
                  pVR8X  d   RMRpV P                   P                  P                  VR7      pVP                  P                  R4      R,           pVP                  VR7      # Nhttpwswss)scheme   /s
   /responses)raw_path)	rZ  websocket_base_urlhttpxURL	_base_urlr  rn  r  rstriprk   ro  r  	ws_schememerge_raw_paths   &    rc   rm  ,AsyncResponsesConnectionManager._prepare_url      ==++7yy!A!ABH]],,33F && 0eI}}..88	8JH!**11$7-G!!>!::rf   c               (    V ^8  d   QhRRRRRRRR/# 	r_   exc_typeztype[BaseException] | Noners  zBaseException | Noneexc_tbzTracebackType | Noner`   rB  ra   )rb   s   "rc   rd   rX    s,     , ,2,9M,Wk,	,rf   c                	v   "   V P                   e%   V P                   P                  4       G R j  xL
  R # R #  L5irh   )r[  rD  rk   r  rs  r  s   &&&&rc   	__aexit__)AsyncResponsesConnectionManager.__aexit__  s3      (##))+++ )+s   ,97	9__client__connection__extra_headers__extra_query__websocket_connection_optionsN)rk  rl  rm  rn  rT  r  ru  enterrm  r  ro  ra   rf   rc   r  r  B  s)    &K*!X E	;, ,rf   r  c                      ] tR tRt$ RtR]R&   R]R&   R R ltR	 R
 ltR R ltR R lt	R R lt
RRRR/R R lltR R ltRtR# )ResponsesConnectioni  r  ResponsesResponseResourcer  WebSocketConnectionr  c                    V ^8  d   QhRRRR/# )r_   r  r  r`   rB  ra   )rb   s   "rc   rd    ResponsesConnection.__annotate__  s     8 8#6 84 8rf   c                	2    Wn         \        V 4      V n        R # rh   )r  r  r  r
  s   &&rc   r  ResponsesConnection.__init__  s    %1$7rf   c                   V ^8  d   QhRR/# )r_   r`   zIterator[ResponsesServerEvent]ra   )rb   s   "rc   rd   r    s      8 rf   c              #  ^   "   ^ RI Hp   V P                  4       x  K    T d     R# i ; i5ir  r  r  s   & rc   __iter__ResponsesConnection.__iter__  s/     
 	=	iik!! 		s   - *-*-c                   V ^8  d   QhRR/# r  ra   )rb   s   "rc   rd   r    s     3 3* 3rf   c                @    V P                  V P                  4       4      # )r  r  rj   s   &rc   r  ResponsesConnection.recv  s      122rf   c                   V ^8  d   QhRR/# r  ra   )rb   s   "rc   rd   r    s     
 
E 
rf   c                j    V P                   P                  RR7      p\        P                  RV4       V# )r"  Fr#  r%  r&  r(  s   & rc   r  ResponsesConnection.recv_bytes  s1     ""''u'5		2W=rf   c                    V ^8  d   QhRRRR/# r,  ra   )rb   s   "rc   rd   r    s     $ $J $t $rf   c                	    \        V\        4      '       d   VP                  R R R R7      M#\        P                  ! \        V\        4      4      pV P                  P                  V4       R# r/  )	r  r   r3  r4  r5  r    rV   r  r6  r7  s   && rc   r6  ResponsesConnection.send  sU     %++ MMtSWMXOE3LMN 	
 	d#rf   r:  r;  r<  r=  c               $    V ^8  d   QhRRRRRR/# r?  ra   )rb   s   "rc   rd   r    s!     9 9S 9 9d 9rf   c               	>    V P                   P                  WR 7       R# rB  rC  rE  s   &$$rc   rD  ResponsesConnection.close  s    D8rf   c                    V ^8  d   QhRRRR/# rH  ra   )rb   s   "rc   rd   r    rI  rf   c           
         \        \        \        \        P                  ! V4      \        \
        \        4      R7      4      # rK  rN  rP  s   &&rc   r  ResponsesConnection.parse_event  rR  rf   rS  N)rk  rl  rm  rn  rT  rU  r  r  r  r  r6  rD  r  ro  ra   rf   rc   r  r    sG    E''$$8
3
$94 9r 9	
 	
rf   r  c                  N    ] tR tRtRtR R ltR R lt]tR R ltR	 R
 lt	Rt
R# )rc  i  a  
Context manager over a `ResponsesConnection` that is returned by `responses.connect()`

This context manager ensures that the connection will be closed when it exits.

---

Note that if your application doesn't work well with the context manager approach then you
can call the `.enter()` method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = client.responses.connect(...).enter()
# ...
connection.close()
```
c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r_   rf  rX   r   r   r   r   rb  rL   r`   rB  ra   )rb   s   "rc   rd   'ResponsesConnectionManager.__annotate__  sF     K K K 	K
 K 'AK 
Krf   c               	D    Wn         R V n        W n        W0n        W@n        R # rh   )#_ResponsesConnectionManager__client'_ResponsesConnectionManager__connection(_ResponsesConnectionManager__extra_query*_ResponsesConnectionManager__extra_headers9_ResponsesConnectionManager__websocket_connection_optionsr_  s   &$$$$rc   r  #ResponsesConnectionManager.__init__  s#     8<(,.J+rf   c                   V ^8  d   QhRR/# )r_   r`   r  ra   )rb   s   "rc   rd   r  
  s     *! *!. *!rf   c                f    ^ RI Hp T P	                  4       P                  / T P                  P                  P                  CT P                  CR7      p\        P                  RT4       T P                  '       d!   \        P                  RT P                  4       \        T! \        T4      3RT P                  P                  R\!        / T P                  P"                  CT P$                  4      /T P                  B 4      T n        T P&                  #   \         d   p\        R4      ThRp?ii ; i)	u/  
👋 If your application doesn't work well with the context manager approach then you
can call this method directly to initiate a connection.

**Warning**: You must remember to close the connection with `.close()`.

```py
connection = client.responses.connect(...).enter()
# ...
connection.close()
```
rc  rd  Nre  rg  rh  ri  rj  )websockets.sync.clientrh  rl  r9   rm  rn  r  ro  rf  r  r\   r'  r  r  r   rp  r:   rq  r  r  rr  s   &   rc   	__enter__$ResponsesConnectionManager.__enter__
  s(   	d6 !++--((//$$ , 
 			$c*...II.0S0ST/C
"&--":":
 $3--44 ((	$
 55

    7  	dYZ`cc	ds   D D0D++D0c                   V ^8  d   QhRR/# rx  ra   )rb   s   "rc   rd   r  8  ry  rf   c                	   V P                   P                  e,   \        P                  ! V P                   P                  4      pMQV P                   P                  P
                  pVR8X  d   RMRpV P                   P                  P                  VR7      pVP                  P                  R4      R,           pVP                  VR7      # r{  )	r  r  r  r  r  r  rn  r  r  r  s   &    rc   rm  'ResponsesConnectionManager._prepare_url8  r  rf   c               (    V ^8  d   QhRRRRRRRR/# r  ra   )rb   s   "rc   rd   r  C  s,     & &2&9M&Wk&	&rf   c                	Z    V P                   e   V P                   P                  4        R # R # rh   )r  rD  r  s   &&&&rc   __exit__#ResponsesConnectionManager.__exit__C  s'     (##% )rf   r  N)rk  rl  rm  rn  rT  r  r  r  rm  r  ro  ra   rf   rc   rc  rc    s)    &K*!X E	;& &rf   rc  c                  "    ] tR tRtR R ltRtR# )BaseResponsesConnectionResourceiJ  c                    V ^8  d   QhRRRR/# )r_   r  r  r`   rB  ra   )rb   s   "rc   rd   ,BaseResponsesConnectionResource.__annotate__K  s     & &#6 &4 &rf   c                	    Wn         R # rh   r  r
  s   &&rc   r  (BaseResponsesConnectionResource.__init__K      %rf   r  Nrk  rl  rm  rn  r  ro  ra   rf   rc   r  r  J      & &rf   r  c            :          ] tR tRtR]R]R]R]R]R]R]R	]R
]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]/R R  lltR!tR"# )#r  iO  r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c          <         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"RR#R$R%R&R'R(R)R*R+R,R-RR.R&R/R0R1RR2R3/# 4r_   r~   r   r   zIOptional[Iterable[responses_client_event_param.ContextManagement]] | Omitr   z:Optional[responses_client_event_param.Conversation] | Omitr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   z;Optional[responses_client_event_param.StreamOptions] | Omitr   r   r   r   r   z.responses_client_event_param.ToolChoice | Omitr   r   r   r   r   r   r   r`   rB  ra   )rb   s   "rc   rd   &ResponsesResponseResource.__annotate__P  a    G
 G
 *G
 f	G

 QG
 ;G
 5G
 +G
 0G
 -G
 ,G
 %G
 3G
 3G
 5G
  %!G
" !M#G
$ .%G
& &'G
( _)G
* %+G
, &-G
. T/G
0 ,1G
2 -3G
4 D5G
6 *7G
8 +9G
: &;G
< A=G
> ?G
@ 
AG
rf   c          "     	   V P                   P                  \        \        \	        / R RbRVbRVbRVbRVbRVbRVbRVbR	VbR
V	bRV
bRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRVRVRVRV/C4      4      4       R#  r  zresponse.creater~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Nr  r6  r   rV   r!   rk   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r    ResponsesResponseResource.createP  sI   B 	) 1$j -.@ '	
 "7   ' ,-> ). #H   ./B /0D !& +,<  12H!" $Y#$ ,->& &(.%{%{&$j=!$&	
rf   ra   Nrk  rl  rm  rn  r   r   ro  ra   rf   rc   r  r  O  \   G
 -1G
 im	G

 TXG
 >BG
 8<G
 .2G
 37G
 04G
 /3G
 (,G
 6:G
 6:G
 8<G
  (,!G
" PT#G
$ 15%G
& )-'G
( bf)G
* (,+G
, )--G
. W[/G
0 /31G
2 043G
4 GK5G
6 -17G
8 .29G
: )-;G
< DH=G
>  ?G
 G
rf   r  c                  "    ] tR tRtR R ltRtR# )$BaseAsyncResponsesConnectionResourcei  c                    V ^8  d   QhRRRR/# )r_   r  r  r`   rB  ra   )rb   s   "rc   rd   1BaseAsyncResponsesConnectionResource.__annotate__  s     & &#; & &rf   c                	    Wn         R # rh   r  r
  s   &&rc   r  -BaseAsyncResponsesConnectionResource.__init__  r  rf   r  Nr  ra   rf   rc   r  r    r  rf   r  c            :          ] tR tRtR]R]R]R]R]R]R]R	]R
]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]R]/R R  lltR!tR"# )#r  i  r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c          <         V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRRRRRRRRRRRR R!RR"RR#R$R%R&R'R(R)R*R+R,R-RR.R&R/R0R1RR2R3/# r  ra   )rb   s   "rc   rd   +AsyncResponsesResponseResource.__annotate__  r  rf   c          "     	$  "   V P                   P                  \        \        \	        / R RbRVbRVbRVbRVbRVbRVbRVbR	VbR
V	bRV
bRVbRVbRVbRVbRVbRVbRVRVRVRVRVRVRVRVRVRVRVRVRV/C4      4      4      G Rj  xL
  R#  L5ir  r  r  s   &$$$$$$$$$$$$$$$$$$$$$$$$$$$$$rc   r   %AsyncResponsesResponseResource.create  sV    B ##) 1$j -.@ '	
 "7   ' ,-> ). #H   ./B /0D !& +,<  12H!" $Y#$ ,->& &(.%{%{&$j=!$&
 &	
 &	
s   BBBBra   Nr  ra   rf   rc   r  r    r  rf   r  )__conditional_annotations__
__future__r   r4  loggingr   typesr   typingr   r   r   r	   r
   r   r   r   r   r   	functoolsr   typing_extensionsr   r   r  pydanticr   r=  r   _typesr   r   r   r   r   r   r   r   r   _utilsr   r   r    r!   r"   _compatr#   _modelsr$   	_resourcer%   r&   	_responser'   r(   rl   r)   r*   r+   r,   r-   r.   
_streamingr/   r0   
lib._toolsr1   r2   rp   r3   r4   r5   r6   r7   r8   _exceptionsr9   _base_clientr:   r;   types.responsesr<   r=   r>   r?   lib._parsing._responsesr@   rA   rB   r   types.responses.responserC   types.responses.tool_paramrD   rE   types.shared_params.metadatarF   types.shared_params.reasoningrG   types.responses.parsed_responserH   "lib.streaming.responses._responsesrI   rJ   "types.responses.compacted_responserK   "types.websocket_connection_optionsrL   #types.responses.response_includablerM   #types.shared_params.responses_modelrN   $types.responses.response_input_paramrO   %types.responses.response_prompt_paramrP   %types.responses.response_stream_eventrQ   &types.responses.responses_client_eventrR   &types.responses.responses_server_eventrS   )types.responses.response_input_item_paramrT   *types.responses.response_text_config_paramrU   ,types.responses.responses_client_event_paramrV   r  rW   r  rk  r  ri   rX   rY   __all__	getLoggerrk  r\   rU  rZ   r[   rs   ry  ry   r}  r   r  r  r  rc  r  r  r  r  )r  s   @rc   <module>r     s   # "     k k k  /     ` ` ` f f & / : Y  . M  ' A  
 1 G 4 6 = c C L E A F H H J J O Q UNV.(
)''1^ 1@
 @
F4D
% D
N4H H@M M@N N:S S:#LA
 A
H_, _,DA
 A
H_& _&D& &
H
 ? H
V& &
H
%I H
rf   