
    2RjNb                       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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l0m1Z1 ddl2m3Z3 ddgZ4 G d de      Z5 G d de      Z6 G d d      Z7 G d d      Z8 G d d      Z9 G d d      Z:y)     )annotations)AnyListIterablecast)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_template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y)r&   ,Manage conversations and conversation items.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
        )ItemsWithRawResponseselfs    l/var/www/html/meridian/meridian-ai/venv/lib/python3.12/site-packages/openai/resources/conversations/items.pywith_raw_responsezItems.with_raw_response   s     $D))    c                    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
        )ItemsWithStreamingResponser-   s    r/   with_streaming_responsezItems.with_streaming_response)   s     *$//r1   Nincludeextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        d|it        j
                        t        ||||t        d|it        j
                        ddi      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/{conversation_id}/itemsconversation_iditemsr7   bearer_authTr8   r9   r:   r;   querysecuritybodyoptionscast_to)
ValueError_postr   r   r   ItemCreateParamsr   r%   r.   rA   rB   r7   r8   r9   r:   r;   s           r/   createzItems.create2   s    > ]^m]pqrrzzBTcd '5!13E3V3VW(+'%%y'&:<N<_<_`'. )  
 	
r1   c                  |st        d|      |st        d|      t        t        | j                  t	        d||      t        ||||t        d|it        j                        ddi      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
        r>   6Expected a non-empty value for `item_id` but received 0/conversations/{conversation_id}/items/{item_id}rA   item_idr7   rC   TrD   rI   rJ   )
rK   r   r#   _getr   r   r   r    ItemRetrieveParamsr   r.   rU   rA   r7   r8   r9   r:   r;   s           r/   retrievezItems.retrievea   s    : ]^m]pqrrUV]U`abbIIFXgqx -"/ +)#)9g*>@T@g@gh+T2 S"23  
 	
r1   afterr7   limitorderr8   r9   r:   r;   c                   |st        d|      | j                  t        d|      t        t           t        ||||	t        ||||dt        j                        ddi      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
        r>   r?   r@   )r\   r7   r]   r^   rC   TrD   )pagerI   model)rK   _get_api_listr   r   r#   r   r   r   ItemListParamsr   r   
r.   rA   r\   r7   r]   r^   r8   r9   r:   r;   s
             r/   listz
Items.list   s    p ]^m]pqrr!!BTcd+,<=(+'%%!&#*!&!&	 %33 (.  s,-' " 
 	
r1   r8   r9   r:   r;   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      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
        r>   rR   rS   rT   rC   Tr8   r9   r:   r;   rF   rV   rK   _deleter   r   r!   r.   rU   rA   r8   r9   r:   r;   s          r/   deletezItems.delete   s~    0 ]^m]pqrrUV]U`abb||BTcmt )+'%'. !  
 	
r1   )returnr,   )ro   r4   rA   strrB   z Iterable[ResponseInputItemParam]r7   List[ResponseIncludable] | Omitr8   Headers | Noner9   Query | Noner:   Body | Noner;   'float | httpx.Timeout | None | NotGivenro   r%   rU   rq   rA   rq   r7   rr   r8   rs   r9   rt   r:   ru   r;   rv   ro   r#   )rA   rq   r\   
str | Omitr7   rr   r]   
int | Omitr^   Literal['asc', 'desc'] | Omitr8   rs   r9   rt   r:   ru   r;   rv   ro   z,SyncConversationCursorPage[ConversationItem]rU   rq   rA   rq   r8   rs   r9   rt   r:   ru   r;   rv   ro   r!   __name__
__module____qualname____doc__r   r0   r5   r   r   rO   rZ   rf   rn    r1   r/   r&   r&      s   6* * 0 0 48 )-$("&;D-
-
 0	-

 1-
 &-
 "-
  -
 9-
 
-
h 48 )-$("&;D1
1
 	1

 11
 &1
 "1
  1
 91
 
1
n !37 /3 )-$("&;DN
N
 	N

 1N
 N
 -N
 &N
 "N
  N
 9N
 
6N
n )-$("&;D(
(
 	(
 &(
 "(
  (
 9(
 
(
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y)r'   r)   c                    t        |       S r+   )AsyncItemsWithRawResponser-   s    r/   r0   zAsyncItems.with_raw_response  s     )..r1   c                    t        |       S r3   )AsyncItemsWithStreamingResponser-   s    r/   r5   z"AsyncItems.with_streaming_response  s     /t44r1   Nr6   c               8  K   |st        d|      | j                  t        d|      t        d|it        j
                         d{   t        ||||t        d|it        j
                         d{   ddi	      t        
       d{   S 7 J7  7 w)r=   r>   r?   r@   rB   Nr7   rC   TrD   rG   )rK   rL   r   r   r   rM   r   r%   rN   s           r/   rO   zAsyncItems.create%  s     > ]^m]pqrrZZBTcd,gu-=?Q?b?bcc(+'%19g2FHZHkHkll'. )   
 
 	
c m
s6   AB	B

+B5B6BBBBBc               H  K   |st        d|      |st        d|      t        t        | j                  t	        d||      t        ||||t        d|it        j                         d{   ddi	      t        t        t              
       d{         S 7 07 
w)rQ   r>   rR   rS   rT   r7   NrC   TrD   rV   )
rK   r   r#   rW   r   r   r   r    rX   r   rY   s           r/   rZ   zAsyncItems.retrieveT  s     : ]^m]pqrrUV]U`abb))FXgqx -"/ +)# 5y'6JL`LsLs tt+T2 S"23   
 	
 us$   A+B"-B.'B"B 
	B" B"r[   c                   |st        d|      | j                  t        d|      t        t           t        ||||	t        ||||dt        j                        ddi      t        t        t                    S r`   )rK   rc   r   r   r#   r   r   r   rd   r   r   re   s
             r/   rf   zAsyncItems.list  s    p ]^m]pqrr!!BTcd,-=>(+'%%!&#*!&!&	 %33 (.  s,-' " 
 	
r1   rg   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
ri   r>   rR   rS   rT   rC   Trj   rV   Nrk   rm   s          r/   rn   zAsyncItems.delete  s     0 ]^m]pqrrUV]U`abb\\BTcmt )+'%'. ! " 
 
 	
 
s   AA!AA!)ro   r   )ro   r   rp   rw   )rA   rq   r\   rx   r7   rr   r]   ry   r^   rz   r8   rs   r9   rt   r:   ru   r;   rv   ro   zOAsyncPaginator[ConversationItem, AsyncConversationCursorPage[ConversationItem]]r{   r|   r   r1   r/   r'   r'     s   6/ / 5 5 48 )-$("&;D-
-
 0	-

 1-
 &-
 "-
  -
 9-
 
-
h 48 )-$("&;D1
1
 	1

 11
 &1
 "1
  1
 91
 
1
n !37 /3 )-$("&;DN
N
 	N

 1N
 N
 -N
 &N
 "N
  N
 9N
 
YN
n )-$("&;D(
(
 	(
 &(
 "(
  (
 9(
 
(
r1   c                      e Zd ZddZy)r,   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_itemsr
   to_raw_response_wrapperrO   rZ   rf   rn   r.   rB   s     r/   __init__zItemsWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r1   NrB   r&   ro   Noner}   r~   r   r   r   r1   r/   r,   r,         
r1   r,   c                      e Zd ZddZy)r   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r   )r   r
   async_to_raw_response_wrapperrO   rZ   rf   rn   r   s     r/   r   z"AsyncItemsWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r1   NrB   r'   ro   r   r   r   r1   r/   r   r     r   r1   r   c                      e Zd ZddZy)r4   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rO   rZ   rf   rn   r   s     r/   r   z#ItemsWithStreamingResponse.__init__'  s[    2LL
 5NN
 1JJ
	 3LL
r1   Nr   r   r   r1   r/   r4   r4   &  r   r1   r4   c                      e Zd ZddZy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rO   rZ   rf   rn   r   s     r/   r   z(AsyncItemsWithStreamingResponse.__init__9  s[    8LL
 ;NN
 7JJ
	 9LL
r1   Nr   r   r   r1   r/   r   r   8  r   r1   r   );
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   r   r   _utilsr   r   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   r4   r   r   r1   r/   <module>r      s    # , , %    K K K K K & : Y Q @ ] ] < E E O NL
!p
O p
fp
! p
f
 
$
 
$
 
$
 
r1   