
    iR                       d dl mZ d dl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 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% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddgZ, G d de          Z- G d de          Z. G d d          Z/ G d d          Z0 G d d          Z1 G d d          Z2dS )    )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            
          e Zd Zed$d            Zed%d            Zdddedd&dZeeeeeddded	d'dZ	dddedd(d Z
eeeeddded!d)d#ZdS )*r    returnThreadsWithRawResponsec                     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    l/home/piyush/.hermes/hermes-agent/venv/lib/python3.11/site-packages/openai/resources/beta/chatkit/threads.pywith_raw_responsezThreads.with_raw_response   s     &d+++    ThreadsWithStreamingResponsec                     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Threads.with_streaming_response%   s     ,D111r+   Nextra_headersextra_query
extra_bodytimeout	thread_idstrr1   Headers | Noner2   Query | Noner3   Body | Noner4   'float | httpx.Timeout | None | NotGivenr   c                   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          t          	          S )
`  
        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}r5   bearer_authTr1   r2   r3   r4   securityoptionscast_to
ValueError_getr   r   r   r(   r5   r1   r2   r3   r4   s         r)   retrievezThreads.retrieve.   s    .  	geXaeefff&(9Sm>QrSyy8INNN(+'%'.   "  

 

 
	
r+   	afterbeforelimitorderuserr1   r2   r3   r4   rN   
str | OmitrO   rP   
int | OmitrQ   Literal['asc', 'desc'] | OmitrR   )SyncConversationCursorPage[ChatKitThread]c       	            ddi|pi }|                      dt          t                   t          ||||	t	          |||||dt
          j                  ddi          t                    S 	as  
        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)rN   rO   rP   rQ   rR   rB   Tr1   r2   r3   r4   queryrD   pagerF   model)_get_api_listr   r   r   r   r   ThreadListParams
r(   rN   rO   rP   rQ   rR   r1   r2   r3   r4   s
             r)   listzThreads.listT   s    P '(9Sm>QrS!!+M:(+'%%!&"(!&!& $  '7	 	 (.  "  ) " 
 
 	
r+   r   c                   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          t          	          S )
x  
        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
        r=   r>   r?   r@   rA   rB   TrC   rE   rI   _deleter   r   r   rK   s         r)   deletezThreads.delete   s    .  	geXaeefff&(9Sm>QrS||8INNN(+'%'.   )  

 

 
	
r+   rN   rO   rP   rQ   r1   r2   r3   r4    SyncConversationCursorPage[Data]c               >   |st          d|          ddi|pi }|                     t          d|          t          t                   t          ||||	t          ||||dt          j                  ddi	          t          t          t                    
          S 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
        r=   r>   r?   z"/chatkit/threads/{thread_id}/itemsrA   )rN   rO   rP   rQ   rB   TrY   r[   )rI   r^   r   r   r   r   r   r   ThreadListItemsParamsr   r   
r(   r5   rN   rO   rP   rQ   r1   r2   r3   r4   s
             r)   
list_itemszThreads.list_items   s    J  	geXaeefff&(9Sm>QrS!!>)TTT+D1(+'%%!&"(!&!&	  -B  (.    sD//' " 
 
 	
r+   )r#   r$   )r#   r,   r5   r6   r1   r7   r2   r8   r3   r9   r4   r:   r#   r   )rN   rS   rO   rS   rP   rT   rQ   rU   rR   rS   r1   r7   r2   r8   r3   r9   r4   r:   r#   rV   r5   r6   r1   r7   r2   r8   r3   r9   r4   r:   r#   r   )r5   r6   rN   rS   rO   rS   rP   rT   rQ   rU   r1   r7   r2   r8   r3   r9   r4   r:   r#   rh   __name__
__module____qualname__r   r*   r/   r   rL   r   ra   rf   rm    r+   r)   r    r       s$       , , , _, 2 2 2 _2 )-$("&;D$
 $
 $
 $
 $
 $
R !! /3 )-$("&;D>
 >
 >
 >
 >
 >
L )-$("&;D$
 $
 $
 $
 $
 $
T !! /3 )-$("&;D<
 <
 <
 <
 <
 <
 <
 <
r+   c            
          e Zd Zed$d            Zed%d            Zdddedd&dZeeeeeddded	d'dZ	dddedd(d Z
eeeeddded!d)d#ZdS )*r!   r#   AsyncThreadsWithRawResponsec                     t          |           S r&   )rv   r'   s    r)   r*   zAsyncThreads.with_raw_response   s     +4000r+   !AsyncThreadsWithStreamingResponsec                     t          |           S r.   )rx   r'   s    r)   r/   z$AsyncThreads.with_streaming_response  s     1666r+   Nr0   r5   r6   r1   r7   r2   r8   r3   r9   r4   r:   r   c                  K   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          t          	           d
{V S )r<   r=   r>   r?   r@   rA   rB   TrC   rE   NrH   rK   s         r)   rL   zAsyncThreads.retrieve  s      .  	geXaeefff&(9Sm>QrSYY8INNN(+'%'.   "  

 

 

 

 

 

 

 

 
	
r+   rM   rN   rS   rO   rP   rT   rQ   rU   rR   IAsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]c       	            ddi|pi }|                      dt          t                   t          ||||	t	          |||||dt
          j                  ddi          t                    S rX   )r^   r   r   r   r   r   r_   r`   s
             r)   ra   zAsyncThreads.list3  s    P '(9Sm>QrS!!,];(+'%%!&"(!&!& $  '7	 	 (.  "  ) " 
 
 	
r+   r   c                  K   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          t          	           d
{V S )rc   r=   r>   r?   r@   rA   rB   TrC   rE   Nrd   rK   s         r)   rf   zAsyncThreads.deletes  s      .  	geXaeefff&(9Sm>QrS\\8INNN(+'%'.   ) " 

 

 

 

 

 

 

 

 
	
r+   rg   7AsyncPaginator[Data, AsyncConversationCursorPage[Data]]c               >   |st          d|          ddi|pi }|                     t          d|          t          t                   t          ||||	t          ||||dt          j                  ddi	          t          t          t                    
          S rj   )rI   r^   r   r   r   r   r   r   rk   r   r   rl   s
             r)   rm   zAsyncThreads.list_items  s    J  	geXaeefff&(9Sm>QrS!!>)TTT,T2(+'%%!&"(!&!&	  -B  (.    sD//' " 
 
 	
r+   )r#   rv   )r#   rx   rn   )rN   rS   rO   rS   rP   rT   rQ   rU   rR   rS   r1   r7   r2   r8   r3   r9   r4   r:   r#   r{   ro   )r5   r6   rN   rS   rO   rS   rP   rT   rQ   rU   r1   r7   r2   r8   r3   r9   r4   r:   r#   r~   rp   rt   r+   r)   r!   r!      s$       1 1 1 _1 7 7 7 _7 )-$("&;D$
 $
 $
 $
 $
 $
R !! /3 )-$("&;D>
 >
 >
 >
 >
 >
L )-$("&;D$
 $
 $
 $
 $
 $
T !! /3 )-$("&;D<
 <
 <
 <
 <
 <
 <
 <
r+   c                      e Zd ZddZdS )r$   threadsr    r#   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_threadsr   to_raw_response_wrapperrL   ra   rf   rm   r(   r   s     r)   __init__zThreadsWithRawResponse.__init__  sy    (@
 
 %<L
 
	 '>N
 
 +B
 
r+   Nr   r    r#   r   rq   rr   rs   r   rt   r+   r)   r$   r$     (        
 
 
 
 
 
r+   r$   c                      e Zd ZddZdS )rv   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_wrapperrL   ra   rf   rm   r   s     r)   r   z$AsyncThreadsWithRawResponse.__init__  sy    (F
 
 %BL
 
	 'DN
 
 +H
 
r+   Nr   r!   r#   r   r   rt   r+   r)   rv   rv     r   r+   rv   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   rL   ra   rf   rm   r   s     r)   r   z%ThreadsWithStreamingResponse.__init__  sm    4
 
 1L
 
	 3N
 
 7
 
r+   Nr   r   rt   r+   r)   r,   r,     r   r+   r,   c                      e Zd ZddZdS )rx   r   r!   r#   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rL   ra   rf   rm   r   s     r)   r   z*AsyncThreadsWithStreamingResponse.__init__  sm    :
 
 7L
 
	 9N
 
 =
 
r+   Nr   r   rt   r+   r)   rx   rx     r   r+   rx   )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$   rv   r,   rx   rt   r+   r)   <module>r      s   # " " " " "         % % % % % %  ! ! ! ! ! ! L L L L L L L L L L L L L L L L L L 5 5 5 5 5 5 5 5 ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z R R R R R R R R A A A A A A A A O O O O O O O O ? ? ? ? ? ? N N N N N N @ @ @ @ @ @n
%\
 \
 \
 \
 \
o \
 \
 \
~\
 \
 \
 \
 \
# \
 \
 \
~
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
$
 
 
 
 
 
 
 
 
 
r+   