
    2i^                       d dl mZ d dlmZ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 m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddgZ3 G d de          Z4 G d de          Z5 G d d          Z6 G d d          Z7 G d d          Z8 G d d          Z9dS )     )annotations)AnyListIterablecast)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)SyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)item_list_paramsitem_create_paramsitem_retrieve_params)Conversation)ResponseIncludable)ConversationItem)ResponseInputItemParam)ConversationItemListItems
AsyncItemsc            	          e Zd ZdZed(d            Zed)d            Zedddedd*dZ	edddedd+dZ
eeeedddedd,d$Zddded%d-d'ZdS ).r%   ,Manage conversations and conversation items.returnItemsWithRawResponsec                     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*   selfs    k/root/.openclaw/workspace/.venv-openai/lib/python3.11/site-packages/openai/resources/conversations/items.pywith_raw_responsezItems.with_raw_response   s     $D)))    ItemsWithStreamingResponsec                     t          |           S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r2   r-   s    r/   with_streaming_responsezItems.with_streaming_response)   s     *$///r1   Nincludeextra_headersextra_query
extra_bodytimeoutconversation_idstritems Iterable[ResponseInputItemParam]r7   List[ResponseIncludable] | Omitr8   Headers | Noner9   Query | Noner:   Body | Noner;   'float | httpx.Timeout | None | NotGivenr$   c                   |st          d|          |                     d| dt          d|it          j                  t          ||||t          d|it          j                            t                    S )  
        Create items in a conversation with the given ID.

        Args:
          items: The items to add to the conversation. You may add up to 20 items at a time.

          include: Additional fields to include in the response. See the `include` parameter for
              [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
              for more information.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        >Expected a non-empty value for `conversation_id` but received /conversations//itemsr>   r7   r8   r9   r:   r;   querybodyoptionscast_to)
ValueError_postr   r   ItemCreateParamsr   r$   r.   r<   r>   r7   r8   r9   r:   r;   s           r/   createzItems.create2   s    >  	sq^mqqrrrzz5o555 '5!13E3VWW(+'%%y'&:<N<_``   )  
 
 	
r1   item_idr"   c               <   |st          d|          |st          d|          t          t          |                     d| d| t	          ||||t          d|it          j                            t          t          t                                        S )  
        Get a single item from a conversation with the given IDs.

        Args:
          include: Additional fields to include in the response. See the `include` parameter for
              [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
              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
        rG   6Expected a non-empty value for `item_id` but received rH   /items/r7   rJ   rN   rO   )	rP   r   r"   _getr   r   r   ItemRetrieveParamsr   r.   rU   r<   r7   r8   r9   r:   r;   s           r/   retrievezItems.retrieve`   s    :  	sq^mqqrrr 	caV]aabbbIIC/CC'CC,"/ +)#)9g*>@T@ghh   S"233  
 

 
 	
r1   afterr7   limitorderr8   r9   r:   r;   r`   
str | Omitra   
int | Omitrb   Literal['asc', 'desc'] | Omit,SyncConversationCursorPage[ConversationItem]c                  |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t          t          t                              S a  
        List all items for a conversation with the given ID.

        Args:
          after: An item ID to list items after, used in pagination.

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

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: The order to return the input items in. Default is `desc`.

              - `asc`: Return the input items in ascending order.
              - `desc`: Return the input items in descending order.

          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
        rG   rH   rI   )r`   r7   ra   rb   rJ   )pagerN   model)
rP   _get_api_listr   r"   r   r   r   ItemListParamsr   r   
r.   r<   r`   r7   ra   rb   r8   r9   r:   r;   s
             r/   listz
Items.list   s    p  	sq^mqqrrr!!5o555+,<=(+'%%!&#*!&!&	  %3    s,--% " 
 
 	
r1   r8   r9   r:   r;   r    c          	         |st          d|          |st          d|          |                     d| d| t          ||||          t                    S )j  
        Delete an item from a conversation with the given IDs.

        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
        rG   rX   rH   rY   ro   rZ   rP   _deleter   r    r.   rU   r<   r8   r9   r:   r;   s          r/   deletezItems.delete   s    0  	sq^mqqrrr 	caV]aabbb||?o??g??(+Q[el   !  
 
 	
r1   )r)   r*   )r)   r2   r<   r=   r>   r?   r7   r@   r8   rA   r9   rB   r:   rC   r;   rD   r)   r$   rU   r=   r<   r=   r7   r@   r8   rA   r9   rB   r:   rC   r;   rD   r)   r"   )r<   r=   r`   rc   r7   r@   ra   rd   rb   re   r8   rA   r9   rB   r:   rC   r;   rD   r)   rf   rU   r=   r<   r=   r8   rA   r9   rB   r:   rC   r;   rD   r)   r    __name__
__module____qualname____doc__r   r0   r5   r   r   rT   r^   rn   ru    r1   r/   r%   r%      s)       66* * * _* 0 0 0 _0 48 )-$("&;D,
 ,
 ,
 ,
 ,
 ,
f 48 )-$("&;D.
 .
 .
 .
 .
 .
h !37 /3 )-$("&;DM
 M
 M
 M
 M
 M
l )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r1   c            	          e Zd ZdZed(d            Zed)d            Zedddedd*dZ	edddedd+dZ
eeeedddedd,d$Zddded%d-d'ZdS ).r&   r(   r)   AsyncItemsWithRawResponsec                     t          |           S r,   )r   r-   s    r/   r0   zAsyncItems.with_raw_response  s     )...r1   AsyncItemsWithStreamingResponsec                     t          |           S r4   )r   r-   s    r/   r5   z"AsyncItems.with_streaming_response  s     /t444r1   Nr6   r<   r=   r>   r?   r7   r@   r8   rA   r9   rB   r:   rC   r;   rD   r$   c               "  K   |st          d|          |                     d| dt          d|it          j                   d{V t          ||||t          d|it          j                   d{V           t                     d{V S )	rF   rG   rH   rI   r>   Nr7   rJ   rL   )rP   rQ   r   r   rR   r   r$   rS   s           r/   rT   zAsyncItems.create  s      >  	sq^mqqrrrZZ5o555,gu-=?Q?bcccccccc(+'%19g2FHZHkllllllll   )   
 
 
 
 
 
 
 
 	
r1   rU   r"   c               X  K   |st          d|          |st          d|          t          t          |                     d| d| t	          ||||t          d|it          j                   d{V           t          t          t                               d{V           S )	rW   rG   rX   rH   rY   r7   NrJ   rZ   )	rP   r   r"   r[   r   r   r   r\   r   r]   s           r/   r^   zAsyncItems.retrieveH  s      :  	sq^mqqrrr 	caV]aabbb))C/CC'CC,"/ +)# 5y'6JL`Ls t ttttttt   S"233  
 
 
 
 
 
 
 

 
 	
r1   r_   r`   rc   ra   rd   rb   re   OAsyncPaginator[ConversationItem, AsyncConversationCursorPage[ConversationItem]]c                  |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t          t          t                              S rh   )
rP   rk   r   r"   r   r   r   rl   r   r   rm   s
             r/   rn   zAsyncItems.listx  s    p  	sq^mqqrrr!!5o555,-=>(+'%%!&#*!&!&	  %3    s,--% " 
 
 	
r1   ro   r    c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )rq   rG   rX   rH   rY   ro   rZ   Nrr   rt   s          r/   ru   zAsyncItems.delete  s      0  	sq^mqqrrr 	caV]aabbb\\?o??g??(+Q[el   ! " 
 
 
 
 
 
 
 
 	
r1   )r)   r   )r)   r   rv   rw   )r<   r=   r`   rc   r7   r@   ra   rd   rb   re   r8   rA   r9   rB   r:   rC   r;   rD   r)   r   rx   ry   r~   r1   r/   r&   r&     s)       66/ / / _/ 5 5 5 _5 48 )-$("&;D,
 ,
 ,
 ,
 ,
 ,
f 48 )-$("&;D.
 .
 .
 .
 .
 .
h !37 /3 )-$("&;DM
 M
 M
 M
 M
 M
l )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r1   c                      e Zd ZddZdS )r*   r>   r%   r)   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_itemsr
   to_raw_response_wrapperrT   r^   rn   ru   r.   r>   s     r/   __init__zItemsWithRawResponse.__init__  sw    &>L
 
 )@N
 
 %<J
 
	 '>L
 
r1   Nr>   r%   r)   r   rz   r{   r|   r   r~   r1   r/   r*   r*     (        
 
 
 
 
 
r1   r*   c                      e Zd ZddZdS )r   r>   r&   r)   r   c                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r   )r   r
   async_to_raw_response_wrapperrT   r^   rn   ru   r   s     r/   r   z"AsyncItemsWithRawResponse.__init__  sw    &DL
 
 )FN
 
 %BJ
 
	 'DL
 
r1   Nr>   r&   r)   r   r   r~   r1   r/   r   r     r   r1   r   c                      e Zd ZddZdS )r2   r>   r%   r)   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rT   r^   rn   ru   r   s     r/   r   z#ItemsWithStreamingResponse.__init__  sk    2L
 
 5N
 
 1J
 
	 3L
 
r1   Nr   r   r~   r1   r/   r2   r2     r   r1   r2   c                      e Zd ZddZdS )r   r>   r&   r)   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rT   r^   rn   ru   r   s     r/   r   z(AsyncItemsWithStreamingResponse.__init__#  sk    8L
 
 ;N
 
 7J
 
	 9L
 
r1   Nr   r   r~   r1   r/   r   r   "  r   r1   r   ):
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.conversationsr   r   r    types.conversations.conversationr    #types.responses.response_includabler!   %types.conversations.conversation_itemr"   )types.responses.response_input_item_paramr#   *types.conversations.conversation_item_listr$   __all__r%   r&   r*   r   r2   r   r~   r1   r/   <module>r      s   # " " " " " , , , , , , , , , , , , % % % % % %              K K K K K K K K K K K K K K K K K K < < < < < < < < & & & & & & : : : : : : : : Y Y Y Y Y Y Y Y Q Q Q Q Q Q Q Q @ @ @ @ @ @ @ @ ] ] ] ] ] ] ] ] ] ] < < < < < < E E E E E E E E E E E E O O O O O O N N N N N NL
!e
 e
 e
 e
 e
O e
 e
 e
Pe
 e
 e
 e
 e
! e
 e
 e
P
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
 
 
r1   