o
    wqimN                     @  sP  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 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 deZ,G dd deZ-G dd dZ.G dd dZ/G dd dZ0G dd dZ1dS )    )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                
   @     e Zd Zed*ddZed+ddZddded	d,ddZeeeeeddded	d-d!d"Z	ddded	d.d$d%Z
eeeeddded&d/d(d)ZdS )0r   returnThreadsWithRawResponsec                 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
        )r"   self r'   l/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/openai/resources/beta/chatkit/threads.pywith_raw_response      zThreads.with_raw_responseThreadsWithStreamingResponsec                 C  r#   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%   r'   r'   r(   with_streaming_response%      zThreads.with_streaming_responseNextra_headersextra_query
extra_bodytimeout	thread_idstrr0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGivenr   c                C  D   |s	t d|ddi|pi }| jd| t||||dtdS )M  
        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/r/   optionsZcast_to
ValueError_getr   r   r&   r4   r0   r1   r2   r3   r'   r'   r(   retrieve.      zThreads.retrieve	afterbeforelimitorderuserr0   r1   r2   r3   rI   
str | OmitrJ   rK   
int | OmitrL   Literal['asc', 'desc'] | OmitrM   )SyncConversationCursorPage[ChatKitThread]c       	   
      C  H   ddi|pi }| j dtt t||||	t|||||dtjdtdS aH  
        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
        r=   r>   z/chatkit/threads)rI   rJ   rK   rL   rM   r0   r1   r2   r3   querypagerA   model)_get_api_listr   r   r   r   r   ThreadListParams
r&   rI   rJ   rK   rL   rM   r0   r1   r2   r3   r'   r'   r(   listP   *   (zThreads.listr   c                C  r:   )K  
        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
        r<   r=   r>   r?   r/   r@   rC   _deleter   r   rE   r'   r'   r(   delete   rG   zThreads.deleterI   rJ   rK   rL   r0   r1   r2   r3    SyncConversationCursorPage[Data]c          
      C  f   |s	t d|ddi|pi }| jd| dtt t||||	t||||dtjdtt	tdS 	a  
        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
        r<   r=   r>   r?   z/items)rI   rJ   rK   rL   rT   rV   )
rC   rY   r   r   r   r   r   ThreadListItemsParamsr   r   
r&   r4   rI   rJ   rK   rL   r0   r1   r2   r3   r'   r'   r(   
list_items   ,   %
zThreads.list_items)r!   r"   )r!   r+   r4   r5   r0   r6   r1   r7   r2   r8   r3   r9   r!   r   )rI   rN   rJ   rN   rK   rO   rL   rP   rM   rN   r0   r6   r1   r7   r2   r8   r3   r9   r!   rQ   r4   r5   r0   r6   r1   r7   r2   r8   r3   r9   r!   r   )r4   r5   rI   rN   rJ   rN   rK   rO   rL   rP   r0   r6   r1   r7   r2   r8   r3   r9   r!   rc   __name__
__module____qualname__r   r)   r-   r   rF   r   r\   ra   rh   r'   r'   r'   r(   r      D    	%E&c                
   @  r    )0r   r!   AsyncThreadsWithRawResponsec                 C  r#   r$   )rq   r%   r'   r'   r(   r)      r*   zAsyncThreads.with_raw_response!AsyncThreadsWithStreamingResponsec                 C  r#   r,   )rr   r%   r'   r'   r(   r-      r.   z$AsyncThreads.with_streaming_responseNr/   r4   r5   r0   r6   r1   r7   r2   r8   r3   r9   r   c                  L   |s
t d|ddi|pi }| jd| t||||dtdI dH S )r;   r<   r=   r>   r?   r/   r@   NrB   rE   r'   r'   r(   rF        zAsyncThreads.retrieverH   rI   rN   rJ   rK   rO   rL   rP   rM   IAsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]c       	   
      C  rR   rS   )rY   r   r   r   r   r   rZ   r[   r'   r'   r(   r\   %  r]   zAsyncThreads.listr   c                  rs   )r^   r<   r=   r>   r?   r/   r@   Nr_   rE   r'   r'   r(   ra   d  rt   zAsyncThreads.deleterb   7AsyncPaginator[Data, AsyncConversationCursorPage[Data]]c          
      C  rd   re   )
rC   rY   r   r   r   r   r   rf   r   r   rg   r'   r'   r(   rh     ri   zAsyncThreads.list_items)r!   rq   )r!   rr   rj   )rI   rN   rJ   rN   rK   rO   rL   rP   rM   rN   r0   r6   r1   r7   r2   r8   r3   r9   r!   ru   rk   )r4   r5   rI   rN   rJ   rN   rK   rO   rL   rP   r0   r6   r1   r7   r2   r8   r3   r9   r!   rv   rl   r'   r'   r'   r(   r      rp   c                   @     e Zd ZdddZdS )	r"   threadsr   r!   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S N)_threadsr   Zto_raw_response_wrapperrF   r\   ra   rh   r&   rx   r'   r'   r(   __init__     
zThreadsWithRawResponse.__init__Nrx   r   r!   ry   rm   rn   ro   r~   r'   r'   r'   r(   r"         r"   c                   @  rw   )	rq   rx   r   r!   ry   c                 C  rz   r{   )r|   r   Zasync_to_raw_response_wrapperrF   r\   ra   rh   r}   r'   r'   r(   r~     r   z$AsyncThreadsWithRawResponse.__init__Nrx   r   r!   ry   r   r'   r'   r'   r(   rq     r   rq   c                   @  rw   )	r+   rx   r   r!   ry   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S r{   )r|   r   rF   r\   ra   rh   r}   r'   r'   r(   r~        
z%ThreadsWithStreamingResponse.__init__Nr   r   r'   r'   r'   r(   r+     r   r+   c                   @  rw   )	rr   rx   r   r!   ry   c                 C  r   r{   )r|   r   rF   r\   ra   rh   r}   r'   r'   r(   r~     r   z*AsyncThreadsWithStreamingResponse.__init__Nr   r   r'   r'   r'   r(   rr     r   rr   )2
__future__r   typingr   r   Ztyping_extensionsr   Zhttpx r   _typesr   r	   r
   r   r   r   r   _utilsr   Z_compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.chatkitr   r   Z!types.beta.chatkit.chatkit_threadr   Z)types.beta.chatkit.thread_delete_responser   Z+types.beta.chatkit.chatkit_thread_item_listr   __all__r   r   r"   rq   r+   rr   r'   r'   r'   r(   <module>   s2   $ V V