
    iHP                    x   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      Z2y)    )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y)r    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
        )ThreadsWithRawResponseselfs    v/Users/manta/Documents/Projects/TheRoad-I1/.venv/lib/python3.12/site-packages/openai/resources/beta/chatkit/threads.pywith_raw_responsezThreads.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
        )ThreadsWithStreamingResponser&   s    r(   with_streaming_responsezThreads.with_streaming_response%   s     ,D11r*   Nextra_headersextra_query
extra_bodytimeoutc          	         |st        d|      ddi|xs i }| j                  t        d|      t        ||||      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}	thread_idr/   optionscast_to
ValueError_getr   r   r   r'   r;   r0   r1   r2   r3   s         r(   retrievezThreads.retrieve.   sj    . WXaWdeff&(9Sm>QrSyy8IN(+Q[el "  
 	
r*   	afterbeforelimitorderuserr0   r1   r2   r3   c       	            ddi|xs i }| j                  dt        t           t        ||||	t	        |||||dt
        j                              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
        r7   r8   z/chatkit/threads)rE   rF   rG   rH   rI   r0   r1   r2   r3   querypager=   model)_get_api_listr   r   r   r   r   ThreadListParams
r'   rE   rF   rG   rH   rI   r0   r1   r2   r3   s
             r(   listzThreads.listP   s}    P '(9Sm>QrS!!+M:(+'%%!&"(!&!& $ '77	   ' " 
 	
r*   c          	         |st        d|      ddi|xs i }| j                  t        d|      t        ||||      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
        r6   r7   r8   r9   r:   r/   r<   r@   _deleter   r   r   rB   s         r(   deletezThreads.delete   sj    . WXaWdeff&(9Sm>QrS||8IN(+Q[el )  
 	
r*   rE   rF   rG   rH   r0   r1   r2   r3   c                  |st        d|      ddi|xs i }| j                  t        d|      t        t           t        ||||	t        ||||dt        j                              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
        r6   r7   r8   z"/chatkit/threads/{thread_id}/itemsr:   )rE   rF   rG   rH   rL   rN   )r@   rQ   r   r   r   r   r   r   ThreadListItemsParamsr   r   
r'   r;   rE   rF   rG   rH   r0   r1   r2   r3   s
             r(   
list_itemszThreads.list_items   s    J WXaWdeff&(9Sm>QrS!!>)T+D1(+'%%!&"(!&!&	 -BB sD/% " 
 	
r*   )returnr%   )r`   r-   r;   strr0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGivenr`   r   )rE   
str | OmitrF   rg   rG   
int | OmitrH   Literal['asc', 'desc'] | OmitrI   rg   r0   rc   r1   rd   r2   re   r3   rf   r`   z)SyncConversationCursorPage[ChatKitThread]r;   rb   r0   rc   r1   rd   r2   re   r3   rf   r`   r   )r;   rb   rE   rg   rF   rg   rG   rh   rH   ri   r0   rc   r1   rd   r2   re   r3   rf   r`   z SyncConversationCursorPage[Data]__name__
__module____qualname__r   r)   r.   r   rC   r   rT   rY   r_    r*   r(   r    r       s   , , 2 2 )-$("&;D 
 
 & 
 " 
   
 9 
 
 
J !! /3 )-$("&;D=
 =
 	=

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

 ;
 ;
 -;
 &;
 ";
  ;
 9;
 
*;
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y)r!   c                    t        |       S r$   )AsyncThreadsWithRawResponser&   s    r(   r)   zAsyncThreads.with_raw_response   s     +400r*   c                    t        |       S r,   )!AsyncThreadsWithStreamingResponser&   s    r(   r.   z$AsyncThreads.with_streaming_response   s     166r*   Nr/   c          	        K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||      t               d{   S 7 w)	r5   r6   r7   r8   r9   r:   r/   r<   Nr?   rB   s         r(   rC   zAsyncThreads.retrieve  sx     . WXaWdeff&(9Sm>QrSYY8IN(+Q[el "  
 
 	
 
   AAAArD   c       	            ddi|xs i }| j                  dt        t           t        ||||	t	        |||||dt
        j                              t              S rK   )rQ   r   r   r   r   r   rR   rS   s
             r(   rT   zAsyncThreads.list%  s}    P '(9Sm>QrS!!,];(+'%%!&"(!&!& $ '77	   ' " 
 	
r*   c          	        K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||      t               d{   S 7 w)	rV   r6   r7   r8   r9   r:   r/   r<   NrW   rB   s         r(   rY   zAsyncThreads.deleted  sx     . WXaWdeff&(9Sm>QrS\\8IN(+Q[el ) " 
 
 	
 
rv   rZ   c                  |st        d|      ddi|xs i }| j                  t        d|      t        t           t        ||||	t        ||||dt        j                              t        t        t                    S r\   )r@   rQ   r   r   r   r   r   r   r]   r   r   r^   s
             r(   r_   zAsyncThreads.list_items  s    J WXaWdeff&(9Sm>QrS!!>)T,T2(+'%%!&"(!&!&	 -BB sD/% " 
 	
r*   )r`   rr   )r`   rt   ra   )rE   rg   rF   rg   rG   rh   rH   ri   rI   rg   r0   rc   r1   rd   r2   re   r3   rf   r`   zIAsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]rj   )r;   rb   rE   rg   rF   rg   rG   rh   rH   ri   r0   rc   r1   rd   r2   re   r3   rf   r`   z7AsyncPaginator[Data, AsyncConversationCursorPage[Data]]rk   ro   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                      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)_threadsr   to_raw_response_wrapperrC   rT   rY   r_   r'   threadss     r(   __init__zThreadsWithRawResponse.__init__  sw    (@@
 %<<LL
	 '>>NN
 +BB
r*   Nr   r    r`   Nonerl   rm   rn   r   ro   r*   r(   r%   r%         
r*   r%   c                      e Zd ZddZy)rr   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r|   )r}   r   async_to_raw_response_wrapperrC   rT   rY   r_   r   s     r(   r   z$AsyncThreadsWithRawResponse.__init__  sw    (FF
 %BBLL
	 'DDNN
 +HH
r*   Nr   r!   r`   r   r   ro   r*   r(   rr   rr     r   r*   rr   c                      e Zd ZddZy)r-   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r|   )r}   r   rC   rT   rY   r_   r   s     r(   r   z%ThreadsWithStreamingResponse.__init__  s_    4
 1LL
	 3NN
 7
r*   Nr   r   ro   r*   r(   r-   r-     r   r*   r-   c                      e Zd ZddZy)rt   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r|   )r}   r   rC   rT   rY   r_   r   s     r(   r   z*AsyncThreadsWithStreamingResponse.__init__  s_    :
 7LL
	 9NN
 =
r*   Nr   r   ro   r*   r(   rt   rt     r   r*   rt   )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%   rr   r-   rt   ro   r*   r(   <module>r      s    #  %  ! L L L 5 ' ; Z R A O ? N @n
%R
o R
jR
# R
j
 
$
 
$
 
$
 
r*   