
    _jNb                       S SK Jr  S SKJrJrJrJr  S SKJr  S SK	r	SSK
Jr  SSKJrJrJrJrJrJrJr  SSKJrJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSK J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'J(r(J)r)  SSK*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SS/r4 " S S\5      r5 " S S\5      r6 " S S5      r7 " S S5      r8 " S S5      r9 " S S5      r:g)     )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            	      (   \ rS rSrSr\SS j5       r\SS j5       r\SSS\	S.               SS jjr
\SSS\	S.               SS jjr\\\\SSS\	S	.                   SS
 jjrSSS\	S.             SS jjrSrg)r&      ,Manage conversations and conversation items.c                    [        U 5      $ 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
)ItemsWithRawResponseselfs    Y/home/rurouni/.local/lib/python3.13/site-packages/openai/resources/conversations/items.pywith_raw_responseItems.with_raw_response   s     $D))    c                    [        U 5      $ 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    r0   with_streaming_responseItems.with_streaming_response)   s     *$//r3   Nincludeextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eU R                  [        SUS9[        SU0[        R
                  5      [        UUUU[        SU0[        R
                  5      SS0S9[        S	9$ )
  
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itemsr:   bearer_authTr;   r<   r=   r>   querysecuritybodyoptionscast_to)
ValueError_postr   r   r   ItemCreateParamsr   r%   r/   rD   rE   r:   r;   r<   r=   r>   s           r0   createItems.create2   s    > ]^m]pqrrzzBTcd '5!13E3V3VW(+'%%y'&:<N<_<_`'. )  
 	
r3   c                  U(       d  [        SU< 35      eU(       d  [        SU< 35      e[        [        U R                  [	        SX!S9[        UUUU[        SU0[        R                  5      SS0S9[        [        [        5      S	95      $ )
>  
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
rA   6Expected a non-empty value for `item_id` but received 0/conversations/{conversation_id}/items/{item_id}rD   item_idr:   rF   TrG   rL   rM   )
rN   r   r#   _getr   r   r   r    ItemRetrieveParamsr   r/   rY   rD   r:   r;   r<   r=   r>   s           r0   retrieveItems.retrievea   s    : ]^m]pqrrUV]U`abbIIFXg -"/ +)#)9g*>@T@g@gh+T2 S"23  
 	
r3   afterr:   limitorderr;   r<   r=   r>   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU	[        UUUUS.[        R                  5      SS0S9[        [        [        5      S9$ 	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
rA   rB   rC   )ra   r:   rb   rc   rF   TrG   )pagerL   model)rN   _get_api_listr   r   r#   r   r   r   ItemListParamsr   r   
r/   rD   ra   r:   rb   rc   r;   r<   r=   r>   s
             r0   list
Items.list   s    p ]^m]pqrr!!BTcd+,<=(+'%%!&#*!&!&	 %33 (.  s,-' " 
 	
r3   r;   r<   r=   r>   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9$ )	2  
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
rA   rV   rW   rX   rF   Tr;   r<   r=   r>   rI   rZ   rN   _deleter   r   r!   r/   rY   rD   r;   r<   r=   r>   s          r0   deleteItems.delete   s{    0 ]^m]pqrrUV]U`abb||BTc )+'%'. !  
 	
r3    )returnr-   )rw   r6   rD   strrE   z Iterable[ResponseInputItemParam]r:   List[ResponseIncludable] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenrw   r%   rY   ry   rD   ry   r:   rz   r;   r{   r<   r|   r=   r}   r>   r~   rw   r#   )rD   ry   ra   
str | Omitr:   rz   rb   
int | Omitrc   Literal['asc', 'desc'] | Omitr;   r{   r<   r|   r=   r}   r>   r~   rw   z,SyncConversationCursorPage[ConversationItem]rY   ry   rD   ry   r;   r{   r<   r|   r=   r}   r>   r~   rw   r!   __name__
__module____qualname____firstlineno____doc__r   r1   r7   r   r   rR   r^   rk   rt   __static_attributes__rv   r3   r0   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(
 
(
 (
r3   c            	      (   \ rS rSrSr\SS j5       r\SS j5       r\SSS\	S.               SS jjr
\SSS\	S.               SS jjr\\\\SSS\	S	.                   SS
 jjrSSS\	S.             SS jjrSrg)r'   i  r*   c                    [        U 5      $ r,   )AsyncItemsWithRawResponser.   s    r0   r1   AsyncItems.with_raw_response  s     )..r3   c                    [        U 5      $ r5   )AsyncItemsWithStreamingResponser.   s    r0   r7   "AsyncItems.with_streaming_response  s     /t44r3   Nr9   c               2  #    U(       d  [        SU< 35      eU R                  [        SUS9[        SU0[        R
                  5      I Sh  vN [        UUUU[        SU0[        R
                  5      I Sh  vN SS0S	9[        S
9I Sh  vN $  ND N N7f)r@   rA   rB   rC   rE   Nr:   rF   TrG   rJ   )rN   rO   r   r   r   rP   r   r%   rQ   s           r0   rR   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8B9BBBBBc               L  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      e[        [        U R                  [	        SX!S9[        UUUU[        SU0[        R                  5      I Sh  vN SS0S	9[        [        [        5      S
9I Sh  vN 5      $  N* N
7f)rU   rA   rV   rW   rX   r:   NrF   TrG   rZ   )
rN   r   r#   r[   r   r   r   r    r\   r   r]   s           r0   r^   AsyncItems.retrieveT  s     : ]^m]pqrrUV]U`abb))FXg -"/ +)# 5y'6JL`LsLs tt+T2 S"23   
 	
 us$   A3B$5B 6!B$B"
	B$"B$r`   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU	[        UUUUS.[        R                  5      SS0S9[        [        [        5      S9$ re   )rN   rh   r   r   r#   r   r   r   ri   r   r   rj   s
             r0   rk   AsyncItems.list  s    p ]^m]pqrr!!BTcd,-=>(+'%%!&#*!&!&	 %33 (.  s,-' " 
 	
r3   rm   c                  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9I S	h  vN $  N7f)
ro   rA   rV   rW   rX   rF   Trp   rZ   Nrq   rs   s          r0   rt   AsyncItems.delete  s     0 ]^m]pqrrUV]U`abb\\BTc )+'%'. ! " 
 
 	
 
s   AA#A!A#rv   )rw   r   )rw   r   rx   r   )rD   ry   ra   r   r:   rz   rb   r   rc   r   r;   r{   r<   r|   r=   r}   r>   r~   rw   zOAsyncPaginator[ConversationItem, AsyncConversationCursorPage[ConversationItem]]r   r   rv   r3   r0   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(
 
(
 (
r3   c                      \ rS rSrSS jrSrg)r-   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g N)_itemsr
   to_raw_response_wrapperrR   r^   rk   rt   r/   rE   s     r0   __init__ItemsWithRawResponse.__init__  sq    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r3   r   rR   rt   rk   r^   NrE   r&   rw   Noner   r   r   r   r   r   rv   r3   r0   r-   r-         
r3   r-   c                      \ rS rSrSS jrSrg)r   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g r   )r   r
   async_to_raw_response_wrapperrR   r^   rk   rt   r   s     r0   r   "AsyncItemsWithRawResponse.__init__  sq    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r3   r   NrE   r'   rw   r   r   rv   r3   r0   r   r     r   r3   r   c                      \ rS rSrSS jrSrg)r6   i&  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rR   r^   rk   rt   r   s     r0   r   #ItemsWithStreamingResponse.__init__'  sY    2LL
 5NN
 1JJ
	 3LL
r3   r   Nr   r   rv   r3   r0   r6   r6   &  r   r3   r6   c                      \ rS rSrSS jrSrg)r   i8  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rR   r^   rk   rt   r   s     r0   r   (AsyncItemsWithStreamingResponse.__init__9  sY    8LL
 ;NN
 7JJ
	 9LL
r3   r   Nr   r   rv   r3   r0   r   r   8  r   r3   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   r6   r   rv   r3   r0   <module>r      s    # , , %    K K K K K & : Y Q @ ] ] < E E O NL
!p
O p
fp
! p
f
 
$
 
$
 
$
 
r3   