
    	h^                       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 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-m.Z. ddl/m0Z0 ddgZ1 G d de          Z2 G d de          Z3 G d d          Z4 G d d          Z5 G d d          Z6 G d d          Z7dS )     )annotations)AnyListIterablecast)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)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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#   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    q/var/www/html/web-builder-api.evdpl.com/venv/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
        )r/   r*   s    r,   with_streaming_responsezItems.with_streaming_response'   s     *$///r.   Nincludeextra_headersextra_query
extra_bodytimeoutconversation_idstritems Iterable[ResponseInputItemParam]r4   #List[ResponseIncludable] | NotGivenr5   Headers | Noner6   Query | Noner7   Body | Noner8   '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;   r4   r5   r6   r7   r8   querybodyoptionscast_to)
ValueError_postr   r   ItemCreateParamsr   r"   r+   r9   r;   r4   r5   r6   r7   r8   s           r,   createzItems.create0   s    >  	sq^mqqrrrzz5o555 '5!13E3VWW(+'%%y'&:<N<_``   )  
 
 	
r.   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
        rD   6Expected a non-empty value for `item_id` but received rE   /items/r4   rG   rK   rL   )	rM   r   r    _getr   r   r   ItemRetrieveParamsr   r+   rR   r9   r4   r5   r6   r7   r8   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  
 

 
 	
r.   afterr4   limitorderr5   r6   r7   r8   r]   str | NotGivenr^   int | NotGivenr_   !Literal['asc', 'desc'] | NotGiven,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
        rD   rE   rF   )r]   r4   r^   r_   rG   )pagerK   model)
rM   _get_api_listr   r    r   r   r   ItemListParamsr   r   
r+   r9   r]   r4   r^   r_   r5   r6   r7   r8   s
             r,   listz
Items.list   s    p  	sq^mqqrrr!!5o555+,<=(+'%%!&#*!&!&	  %3    s,--% " 
 
 	
r.   r5   r6   r7   r8   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
        rD   rU   rE   rV   rl   rW   rM   _deleter   r   r+   rR   r9   r5   r6   r7   r8   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   !  
 
 	
r.   )r&   r'   )r&   r/   r9   r:   r;   r<   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   r&   r"   rR   r:   r9   r:   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   r&   r    )r9   r:   r]   r`   r4   r=   r^   ra   r_   rb   r5   r>   r6   r?   r7   r@   r8   rA   r&   rc   rR   r:   r9   r:   r5   r>   r6   r?   r7   r@   r8   rA   r&   r   __name__
__module____qualname__r   r-   r2   r   rQ   r[   rk   rr    r.   r,   r#   r#      s%       * * * _* 0 0 0 _0 8A )-$("&;D,
 ,
 ,
 ,
 ,
 ,
f 8A )-$("&;D.
 .
 .
 .
 .
 .
h !*7@ )3< )-$("&;DM
 M
 M
 M
 M
 M
l )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r.   c            	          e 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&   AsyncItemsWithRawResponsec                     t          |           S r)   )r|   r*   s    r,   r-   zAsyncItems.with_raw_response  s     )...r.   AsyncItemsWithStreamingResponsec                     t          |           S r1   )r~   r*   s    r,   r2   z"AsyncItems.with_streaming_response  s     /t444r.   Nr3   r9   r:   r;   r<   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   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 )	rC   rD   rE   rF   r;   Nr4   rG   rI   )rM   rN   r   r   rO   r   r"   rP   s           r,   rQ   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   )   
 
 
 
 
 
 
 
 	
r.   rR   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 )	rT   rD   rU   rE   rV   r4   NrG   rW   )	rM   r   r    rX   r   r   r   rY   r   rZ   s           r,   r[   zAsyncItems.retrieveD  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  
 
 
 
 
 
 
 

 
 	
r.   r\   r]   r`   r^   ra   r_   rb   OAsyncPaginator[ConversationItem, AsyncConversationCursorPage[ConversationItem]]c                  |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t          t          t                              S re   )
rM   rh   r   r    r   r   r   ri   r   r   rj   s
             r,   rk   zAsyncItems.listt  s    p  	sq^mqqrrr!!5o555,-=>(+'%%!&#*!&!&	  %3    s,--% " 
 
 	
r.   rl   r   c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )rn   rD   rU   rE   rV   rl   rW   Nro   rq   s          r,   rr   zAsyncItems.delete  s      0  	sq^mqqrrr 	caV]aabbb\\?o??g??(+Q[el   ! " 
 
 
 
 
 
 
 
 	
r.   )r&   r|   )r&   r~   rs   rt   )r9   r:   r]   r`   r4   r=   r^   ra   r_   rb   r5   r>   r6   r?   r7   r@   r8   rA   r&   r   ru   rv   rz   r.   r,   r$   r$     s%       / / / _/ 5 5 5 _5 8A )-$("&;D,
 ,
 ,
 ,
 ,
 ,
f 8A )-$("&;D.
 .
 .
 .
 .
 .
h !*7@ )3< )-$("&;DM
 M
 M
 M
 M
 M
l )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r.   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_wrapperrQ   r[   rk   rr   r+   r;   s     r,   __init__zItemsWithRawResponse.__init__  sw    &>L
 
 )@N
 
 %<J
 
	 '>L
 
r.   Nr;   r#   r&   r   rw   rx   ry   r   rz   r.   r,   r'   r'     (        
 
 
 
 
 
r.   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_wrapperrQ   r[   rk   rr   r   s     r,   r   z"AsyncItemsWithRawResponse.__init__  sw    &DL
 
 )FN
 
 %BJ
 
	 'DL
 
r.   Nr;   r$   r&   r   r   rz   r.   r,   r|   r|     r   r.   r|   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   rQ   r[   rk   rr   r   s     r,   r   z#ItemsWithStreamingResponse.__init__  sk    2L
 
 5N
 
 1J
 
	 3L
 
r.   Nr   r   rz   r.   r,   r/   r/     r   r.   r/   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   rQ   r[   rk   rr   r   s     r,   r   z(AsyncItemsWithStreamingResponse.__init__  sk    8L
 
 ;N
 
 7J
 
	 9L
 
r.   Nr   r   rz   r.   r,   r~   r~     r   r.   r~   )8
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   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|   r/   r~   rz   r.   r,   <module>r      s   # " " " " " , , , , , , , , , , , , % % % % % %              ? ? ? ? ? ? ? ? ? ? ? ? ? ? < < < < < < < < & & & & & & : : : : : : : : 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
!c
 c
 c
 c
 c
O c
 c
 c
Lc
 c
 c
 c
 c
! c
 c
 c
L
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
 
 
r.   