o
    $i8                     @  sL  d dl mZ d dlmZmZmZ d dlmZ d dlZddl	m
Z
 ddlmZmZmZmZmZmZmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddgZ*G dd deZ+G dd deZ,G dd dZ-G dd dZ.G dd dZ/G dd dZ0dS )    )annotations)UnionIterableOptional)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)input_token_count_params)	ToolParam)	Reasoning)ResponseInputItemParam)InputTokenCountResponseInputTokensAsyncInputTokensc                   @  T   e Zd Zed)ddZed*ddZeeeeeeeeeeeddded	d+d'd(ZdS ),r   returnInputTokensWithRawResponsec                 C     t | S a  
        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
        )r!   self r&   g/var/www/html/flask_server/venv/lib/python3.10/site-packages/openai/resources/responses/input_tokens.pywith_raw_response      zInputTokens.with_raw_response InputTokensWithStreamingResponsec                 C  r"   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
        )r*   r$   r&   r&   r'   with_streaming_response%      z#InputTokens.with_streaming_responseNconversationinputinstructionsmodelparallel_tool_callsprevious_response_id	reasoningtexttool_choicetools
truncationextra_headersextra_query
extra_bodytimeoutr/   6Optional[input_token_count_params.Conversation] | Omitr0   9Union[str, Iterable[ResponseInputItemParam], None] | Omitr1   Optional[str] | Omitr2   r3   Optional[bool] | Omitr4   r5   Optional[Reasoning] | Omitr6   .Optional[input_token_count_params.Text] | Omitr7   4Optional[input_token_count_params.ToolChoice] | Omitr8   $Optional[Iterable[ToolParam]] | Omitr9   "Literal['auto', 'disabled'] | Omitr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr   c                C  s>   | j dt|||||||||	|
|dtjt||||dtdS )  
        Get input token counts

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

          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.

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

          reasoning: **gpt-5 and o-series models only** Configuration options for
              [reasoning models](https://platform.openai.com/docs/guides/reasoning).

          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.

          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.

          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/input_tokensr/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   bodyoptionscast_to)_postr   r   InputTokenCountParamsr   r   r%   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r&   r&   r'   count.   s,   PzInputTokens.count)r    r!   )r    r*    r/   r>   r0   r?   r1   r@   r2   r@   r3   rA   r4   r@   r5   rB   r6   rC   r7   rD   r8   rE   r9   rF   r:   rG   r;   rH   r<   rI   r=   rJ   r    r   	__name__
__module____qualname__r   r(   r,   r   r   rV   r&   r&   r&   r'   r      *    	c                   @  r   ),r   r    AsyncInputTokensWithRawResponsec                 C  r"   r#   )r]   r$   r&   r&   r'   r(      r)   z"AsyncInputTokens.with_raw_response%AsyncInputTokensWithStreamingResponsec                 C  r"   r+   )r^   r$   r&   r&   r'   r,      r-   z(AsyncInputTokens.with_streaming_responseNr.   r/   r>   r0   r?   r1   r@   r2   r3   rA   r4   r5   rB   r6   rC   r7   rD   r8   rE   r9   rF   r:   rG   r;   rH   r<   rI   r=   rJ   r   c                  sL   | j dt|||||||||	|
|dtjI dH t||||dtdI dH S )rK   rL   rM   NrN   rO   )rS   r   r   rT   r   r   rU   r&   r&   r'   rV      s.   PzAsyncInputTokens.count)r    r]   )r    r^   rW   rX   r&   r&   r&   r'   r      r\   c                   @     e Zd ZdddZdS )	r!   input_tokensr   r    Nonec                 C     || _ t|j| _d S N)_input_tokensr   to_raw_response_wrapperrV   r%   r`   r&   r&   r'   __init__     
z#InputTokensWithRawResponse.__init__Nr`   r   r    ra   rY   rZ   r[   rg   r&   r&   r&   r'   r!         r!   c                   @  r_   )	r]   r`   r   r    ra   c                 C  rb   rc   )rd   r   async_to_raw_response_wrapperrV   rf   r&   r&   r'   rg     rh   z(AsyncInputTokensWithRawResponse.__init__Nr`   r   r    ra   rj   r&   r&   r&   r'   r]     rk   r]   c                   @  r_   )	r*   r`   r   r    ra   c                 C     || _ t|j| _d S rc   )rd   r   rV   rf   r&   r&   r'   rg   '     
z)InputTokensWithStreamingResponse.__init__Nri   rj   r&   r&   r&   r'   r*   &  rk   r*   c                   @  r_   )	r^   r`   r   r    ra   c                 C  rn   rc   )rd   r   rV   rf   r&   r&   r'   rg   0  ro   z.AsyncInputTokensWithStreamingResponse.__init__Nrm   rj   r&   r&   r&   r'   r^   /  rk   r^   )1
__future__r   typingr   r   r   typing_extensionsr   httpx r   _typesr	   r
   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   _base_clientr   types.responsesr   types.responses.tool_paramr   types.shared_params.reasoningr   )types.responses.response_input_item_paramr   *types.responses.input_token_count_responser   __all__r   r   r!   r]   r*   r^   r&   r&   r&   r'   <module>   s.   $}}			