
    _jR                    x   S SK Jr  S SK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  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%  SSK&J'r'  SSK(J)r)  SSK*J+r+  SS/r, " S S\5      r- " S S\5      r. " S S5      r/ " S S5      r0 " S S5      r1 " S S5      r2g)    )annotations)Anycast)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)thread_list_paramsthread_list_items_params)ChatKitThread)ThreadDeleteResponse)DataThreadsAsyncThreadsc            
      &   \ 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       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
)ThreadsWithRawResponseselfs    Z/home/rurouni/.local/lib/python3.13/site-packages/openai/resources/beta/chatkit/threads.pywith_raw_responseThreads.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
)ThreadsWithStreamingResponser'   s    r)   with_streaming_responseThreads.with_streaming_response%   s     ,D11r,   Nextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUS9[        UUUUSS0S9[        S	9$ )
(  
Retrieve a ChatKit thread by its identifier.

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
8Expected a non-empty value for `thread_id` but received OpenAI-Betachatkit_beta=v1/chatkit/threads/{thread_id}	thread_idbearer_authTr3   r4   r5   r6   securityoptionscast_to
ValueError_getr   r   r   r(   r>   r3   r4   r5   r6   s         r)   retrieveThreads.retrieve.   ss    . WXaWdeff&(9Sm>QrSyy8IN(+'%'. "  

 
	
r,   	afterbeforelimitorderuserr3   r4   r5   r6   c       	            SS0U=(       d    0 EnU R                  S[        [           [        UUUU	[	        UUUUUS.[
        R                  5      SS0S9[        S9$ 	a  
List ChatKit threads with optional pagination and user filters.

Args:
  after: List items created after this thread item ID. Defaults to null for the first
      page.

  before: List items created before this thread item ID. Defaults to null for the newest
      results.

  limit: Maximum number of thread items to return. Defaults to 20.

  order: Sort order for results by creation time. Defaults to `desc`.

  user: Filter threads that belong to this user identifier. Defaults to null to return
      all users.

  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;   z/chatkit/threads)rL   rM   rN   rO   rP   r?   Tr3   r4   r5   r6   queryrA   pagerC   model)_get_api_listr   r   r   r   r   ThreadListParams
r(   rL   rM   rN   rO   rP   r3   r4   r5   r6   s
             r)   listThreads.listT   s    P '(9Sm>QrS!!+M:(+'%%!&"(!&!& $ '77	 (."  ) " 
 	
r,   c                   U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUS9[        UUUUSS0S9[        S	9$ )
@  
Delete a ChatKit thread along with its items and stored attachments.

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
r9   r:   r;   r<   r=   r?   Tr@   rB   rF   _deleter   r   r   rH   s         r)   deleteThreads.delete   ss    . WXaWdeff&(9Sm>QrS||8IN(+'%'. )  

 
	
r,   rL   rM   rN   rO   r3   r4   r5   r6   c                  U(       d  [        SU< 35      eSS0U=(       d    0 En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 items that belong to a ChatKit thread.

Args:
  after: List items created after this thread item ID. Defaults to null for the first
      page.

  before: List items created before this thread item ID. Defaults to null for the newest
      results.

  limit: Maximum number of thread items to return. Defaults to 20.

  order: Sort order for results by creation time. Defaults to `desc`.

  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
r9   r:   r;   z"/chatkit/threads/{thread_id}/itemsr=   )rL   rM   rN   rO   r?   TrS   rU   )rF   rX   r   r   r   r   r   r   ThreadListItemsParamsr   r   
r(   r>   rL   rM   rN   rO   r3   r4   r5   r6   s
             r)   
list_itemsThreads.list_items   s    J WXaWdeff&(9Sm>QrS!!>)T+D1(+'%%!&"(!&!&	 -BB (.  sD/' " 
 	
r,    )returnr&   )rk   r/   r>   strr3   Headers | Noner4   Query | Noner5   Body | Noner6   'float | httpx.Timeout | None | NotGivenrk   r   )rL   
str | OmitrM   rr   rN   
int | OmitrO   Literal['asc', 'desc'] | OmitrP   rr   r3   rn   r4   ro   r5   rp   r6   rq   rk   z)SyncConversationCursorPage[ChatKitThread]r>   rm   r3   rn   r4   ro   r5   rp   r6   rq   rk   r   )r>   rm   rL   rr   rM   rr   rN   rs   rO   rt   r3   rn   r4   ro   r5   rp   r6   rq   rk   z SyncConversationCursorPage[Data]__name__
__module____qualname____firstlineno__r   r*   r0   r   rI   r   r[   ra   rh   __static_attributes__rj   r,   r)   r    r       s   , , 2 2 )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
R !! /3 )-$("&;D>
 >
 	>

 >
 ->
 >
 &>
 ">
  >
 9>
 
3>
L )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
T !! /3 )-$("&;D<
<
 	<

 <
 <
 -<
 &<
 "<
  <
 9<
 
*<
 <
r,   c            
      &   \ 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!      c                    [        U 5      $ r%   )AsyncThreadsWithRawResponser'   s    r)   r*   AsyncThreads.with_raw_response   s     +400r,   c                    [        U 5      $ r.   )!AsyncThreadsWithStreamingResponser'   s    r)   r0   $AsyncThreads.with_streaming_response  s     166r,   Nr2   c                  #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUS9[        UUUUSS0S9[        S	9I S
h  vN $  N7f)r8   r9   r:   r;   r<   r=   r?   Tr@   rB   NrE   rH   s         r)   rI   AsyncThreads.retrieve  s     . WXaWdeff&(9Sm>QrSYY8IN(+'%'. "  

 

 
	
 

   AAAArK   c       	            SS0U=(       d    0 EnU R                  S[        [           [        UUUU	[	        UUUUUS.[
        R                  5      SS0S9[        S9$ rR   )rX   r   r   r   r   r   rY   rZ   s
             r)   r[   AsyncThreads.list3  s    P '(9Sm>QrS!!,];(+'%%!&"(!&!& $ '77	 (."  ) " 
 	
r,   c                  #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUS9[        UUUUSS0S9[        S	9I S
h  vN $  N7f)r^   r9   r:   r;   r<   r=   r?   Tr@   rB   Nr_   rH   s         r)   ra   AsyncThreads.deletes  s     . WXaWdeff&(9Sm>QrS\\8IN(+'%'. ) " 

 

 
	
 

r   rc   c                  U(       d  [        SU< 35      eSS0U=(       d    0 En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   )rF   rX   r   r   r   r   r   r   rf   r   r   rg   s
             r)   rh   AsyncThreads.list_items  s    J WXaWdeff&(9Sm>QrS!!>)T,T2(+'%%!&"(!&!&	 -BB (.  sD/' " 
 	
r,   rj   )rk   r   )rk   r   rl   )rL   rr   rM   rr   rN   rs   rO   rt   rP   rr   r3   rn   r4   ro   r5   rp   r6   rq   rk   zIAsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]ru   )r>   rm   rL   rr   rM   rr   rN   rs   rO   rt   r3   rn   r4   ro   r5   rp   r6   rq   rk   z7AsyncPaginator[Data, AsyncConversationCursorPage[Data]]rv   rj   r,   r)   r!   r!      s   1 1 7 7 )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
R !! /3 )-$("&;D>
 >
 	>

 >
 ->
 >
 &>
 ">
  >
 9>
 
S>
L )-$("&;D$
$
 &$
 "$
  $
 9$
 
$
T !! /3 )-$("&;D<
<
 	<

 <
 <
 -<
 &<
 "<
  <
 9<
 
A<
 <
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 N)_threadsr   to_raw_response_wrapperrI   r[   ra   rh   r(   threadss     r)   __init__ThreadsWithRawResponse.__init__  su    (@@
 %<<LL
	 '>>NN
 +BB
r,   r   ra   r[   rh   rI   Nr   r    rk   Nonerw   rx   ry   rz   r   r{   rj   r,   r)   r&   r&         
r,   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_wrapperrI   r[   ra   rh   r   s     r)   r   $AsyncThreadsWithRawResponse.__init__  su    (FF
 %BBLL
	 'DDNN
 +HH
r,   r   Nr   r!   rk   r   r   rj   r,   r)   r   r     r   r,   r   c                      \ rS rSrSS jrSrg)r/   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   rI   r[   ra   rh   r   s     r)   r   %ThreadsWithStreamingResponse.__init__  s]    4
 1LL
	 3NN
 7
r,   r   Nr   r   rj   r,   r)   r/   r/     r   r,   r/   c                      \ rS rSrSS jrSrg)r   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   rI   r[   ra   rh   r   s     r)   r   *AsyncThreadsWithStreamingResponse.__init__  s]    :
 7LL
	 9NN
 =
r,   r   Nr   r   rj   r,   r)   r   r     r   r,   r   )3
__future__r   typingr   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.beta.chatkitr   r   !types.beta.chatkit.chatkit_threadr   )types.beta.chatkit.thread_delete_responser   +types.beta.chatkit.chatkit_thread_item_listr   __all__r    r!   r&   r   r/   r   rj   r,   r)   <module>r      s    #  %  ! L L L 5 ' ; Z R A O ? N @n
%\
o \
~\
# \
~
 
$
 
$
 
$
 
r,   