
    _imN                    t   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  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      r/ " S S5      r0 " S S5      r1g)    )annotations)Anycast)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)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    a/var/www/html/land-ocr/venv/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 3[        X#XES9[        S9$ )  
Retrieve a ChatKit thread

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/r1   optionscast_to
ValueError_getr   r   r'   	thread_idr2   r3   r4   r5   s         r(   retrieveThreads.retrieve.   sd    . WXaWdeff&(9Sm>QrSyy	{+(+Q[ "  
 	
r+   	afterbeforelimitorderuserr2   r3   r4   r5   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9[        S9$ a  
List ChatKit threads

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
r9   r:   z/chatkit/threads)rG   rH   rI   rJ   rK   r2   r3   r4   r5   querypager=   model)_get_api_listr   r   r   r   r   ThreadListParams
r'   rG   rH   rI   rJ   rK   r2   r3   r4   r5   s
             r(   listThreads.listP   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 3[        X#XES9[        S9$ )  
Delete a ChatKit thread

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
r8   r9   r:   r;   r1   r<   r@   _deleter   r   rB   s         r(   deleteThreads.delete   sd    . WXaWdeff&(9Sm>QrS||	{+(+Q[ )  
 	
r+   rG   rH   rI   rJ   r2   r3   r4   r5   c                  U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        [           [	        UUUU	[        UUUUS.[        R                  5      S9[        [        [        5      S9$ 	al  
List ChatKit thread items

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
r8   r9   r:   r;   z/items)rG   rH   rI   rJ   rN   rP   )
r@   rS   r   r   r   r   r   ThreadListItemsParamsr   r   
r'   rC   rG   rH   rI   rJ   r2   r3   r4   r5   s
             r(   
list_itemsThreads.list_items   s    J WXaWdeff&(9Sm>QrS!!	{&1+D1(+'%%!&"(!&!&	 -BB sD/% " 
 	
r+    )returnr%   )rf   r.   rC   strr2   Headers | Noner3   Query | Noner4   Body | Noner5   'float | httpx.Timeout | None | NotGivenrf   r   )rG   
str | OmitrH   rm   rI   
int | OmitrJ   Literal['asc', 'desc'] | OmitrK   rm   r2   ri   r3   rj   r4   rk   r5   rl   rf   z)SyncConversationCursorPage[ChatKitThread]rC   rh   r2   ri   r3   rj   r4   rk   r5   rl   rf   r   )rC   rh   rG   rm   rH   rm   rI   rn   rJ   ro   r2   ri   r3   rj   r4   rk   r5   rl   rf   z SyncConversationCursorPage[Data]__name__
__module____qualname____firstlineno__r   r)   r/   r   rD   r   rV   r\   rc   __static_attributes__re   r+   r(   r   r      s   , , 2 2 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
J !! /3 )-$("&;D=
 =
 	=

 =
 -=
 =
 &=
 "=
  =
 9=
 
3=
J )-$("&;D 
 
 & 
 " 
   
 9 
 
 
L !! /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(   r/   $AsyncThreads.with_streaming_response   s     166r+   Nr1   c          
        #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)r7   r8   r9   r:   r;   r1   r<   Nr?   rB   s         r(   rD   AsyncThreads.retrieve  sq     . WXaWdeff&(9Sm>QrSYY	{+(+Q[ "  
 
 	
 
   A	AAArF   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9[        S9$ rM   )rS   r   r   r   r   r   rT   rU   s
             r(   rV   AsyncThreads.list%  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 3[        X#XES9[        S9I Sh  vN $  N7f)rY   r8   r9   r:   r;   r1   r<   NrZ   rB   s         r(   r\   AsyncThreads.deleted  sq     . WXaWdeff&(9Sm>QrS\\	{+(+Q[ ) " 
 
 	
 
r   r^   c                  U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        [           [	        UUUU	[        UUUUS.[        R                  5      S9[        [        [        5      S9$ r`   )
r@   rS   r   r   r   r   r   ra   r   r   rb   s
             r(   rc   AsyncThreads.list_items  s    J WXaWdeff&(9Sm>QrS!!	{&1,T2(+'%%!&"(!&!&	 -BB sD/% " 
 	
r+   re   )rf   rz   )rf   r}   rg   )rG   rm   rH   rm   rI   rn   rJ   ro   rK   rm   r2   ri   r3   rj   r4   rk   r5   rl   rf   zIAsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]rp   )rC   rh   rG   rm   rH   rm   rI   rn   rJ   ro   r2   ri   r3   rj   r4   rk   r5   rl   rf   z7AsyncPaginator[Data, AsyncConversationCursorPage[Data]]rq   re   r+   r(   r    r       s   1 1 7 7 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
J !! /3 )-$("&;D=
 =
 	=

 =
 -=
 =
 &=
 "=
  =
 9=
 
S=
J )-$("&;D 
 
 & 
 " 
   
 9 
 
 
L !! /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_wrapperrD   rV   r\   rc   r'   threadss     r(   __init__ThreadsWithRawResponse.__init__  su    (@@
 %<<LL
	 '>>NN
 +BB
r+   r   r\   rV   rc   rD   Nr   r   rf   Nonerr   rs   rt   ru   r   rv   re   r+   r(   r%   r%         
r+   r%   c                      \ rS rSrSS jrSrg)rz   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_wrapperrD   rV   r\   rc   r   s     r(   r   $AsyncThreadsWithRawResponse.__init__  su    (FF
 %BBLL
	 'DDNN
 +HH
r+   r   Nr   r    rf   r   r   re   r+   r(   rz   rz     r   r+   rz   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   rD   rV   r\   rc   r   s     r(   r   %ThreadsWithStreamingResponse.__init__  s]    4
 1LL
	 3NN
 7
r+   r   Nr   r   re   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   rD   rV   r\   rc   r   s     r(   r   *AsyncThreadsWithStreamingResponse.__init__  s]    :
 7LL
	 9NN
 =
r+   r   Nr   r   re   r+   r(   r}   r}     r   r+   r}   )2
__future__r   typingr   r   typing_extensionsr   httpx r   _typesr	   r
   r   r   r   r   r   _utilsr   _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%   rz   r.   r}   re   r+   r(   <module>r      s    #  %  ! L L L & ' ; Z R A O ? N @n
%R
o R
jR
# R
j
 
$
 
$
 
$
 
r+   