o
    Ri%                     @  s`  d dl mZ d dlmZmZ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 ddlmZmZmZmZmZmZ dd	lmZmZmZmZmZmZ dd
lmZm Z 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, ddl-m.Z. ddl/m0Z0 ddgZ1G dd de&Z2G dd de'Z3G dd dZ4G dd dZ5G dd dZ6G dd dZ7dS )    )annotations)AnyMappingcastN   )_legacy_response   )ThreadsAsyncThreadsThreadsWithRawResponseAsyncThreadsWithRawResponseThreadsWithStreamingResponse!AsyncThreadsWithStreamingResponse)SessionsAsyncSessionsSessionsWithRawResponseAsyncSessionsWithRawResponseSessionsWithStreamingResponse"AsyncSessionsWithStreamingResponse)BodyQueryHeadersNotGiven	FileTypes	not_given)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)chatkit_upload_file_params)make_request_options)ChatKitUploadFileResponseChatKitAsyncChatKitc                   @  Z   e Zd ZedddZedddZedd	d
Zed ddZdddedd!ddZ	dS )"r'   returnr   c                 C  
   t | jS N)r   _clientself r0   \/home/air/SG/back/venv/lib/python3.10/site-packages/openai/resources/beta/chatkit/chatkit.pysessions'      
zChatKit.sessionsr	   c                 C  r+   r,   )r	   r-   r.   r0   r0   r1   threads+   r3   zChatKit.threadsChatKitWithRawResponsec                 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
        )r5   r.   r0   r0   r1   with_raw_response/      zChatKit.with_raw_responseChatKitWithStreamingResponsec                 C  r6   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.   r0   r0   r1   with_streaming_response9      zChatKit.with_streaming_responseNextra_headersextra_query
extra_bodytimeoutfiler   r?   Headers | Noner@   Query | NonerA   Body | NonerB   'float | httpx.Timeout | None | NotGivenr&   c                C  sz   ddi|pi }t d|i}tttttf |dggd}|r#d|d< tt| jdt|t	j
|t||||dtttd	S )
  
        Upload a ChatKit file

        Args:
          file: Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
              JPG, JPEG, GIF, or WEBP images.

          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
        OpenAI-Betachatkit_beta=v1rC   pathsmultipart/form-dataContent-Type/chatkit/filesr>   bodyfilesoptionscast_to)r   r   r   r   strobjectr&   _postr   r$   ChatKitUploadFileParamsr%   r   r/   rC   r?   r@   rA   rB   rQ   rR   r0   r0   r1   upload_fileB   s&   
zChatKit.upload_file)r*   r   )r*   r	   )r*   r5   )r*   r:   rC   r   r?   rD   r@   rE   rA   rF   rB   rG   r*   r&   
__name__
__module____qualname__r   r2   r4   r8   r<   r   rZ   r0   r0   r0   r1   r'   &       	c                   @  r)   )"r(   r*   r   c                 C  r+   r,   )r   r-   r.   r0   r0   r1   r2   u   r3   zAsyncChatKit.sessionsr
   c                 C  r+   r,   )r
   r-   r.   r0   r0   r1   r4   y   r3   zAsyncChatKit.threadsAsyncChatKitWithRawResponsec                 C  r6   r7   )ra   r.   r0   r0   r1   r8   }   r9   zAsyncChatKit.with_raw_response!AsyncChatKitWithStreamingResponsec                 C  r6   r;   )rb   r.   r0   r0   r1   r<      r=   z$AsyncChatKit.with_streaming_responseNr>   rC   r   r?   rD   r@   rE   rA   rF   rB   rG   r&   c                  s   ddi|pi }t d|i}tttttf |dggd}|r$d|d< tt| jdt|t	j
I dH |t||||d	tttd
I dH S )rH   rI   rJ   rC   rK   rM   rN   rO   Nr>   rP   )r   r   r   r   rU   rV   r&   rW   r   r$   rX   r%   r   rY   r0   r0   r1   rZ      s(   
zAsyncChatKit.upload_file)r*   r   )r*   r
   )r*   ra   )r*   rb   r[   r\   r0   r0   r0   r1   r(   t   r`   c                   @  2   e Zd ZdddZeddd	ZedddZdS )r5   chatkitr'   r*   Nonec                 C     || _ t|j| _d S r,   )_chatkitr   to_raw_response_wrapperrZ   r/   rd   r0   r0   r1   __init__      
zChatKitWithRawResponse.__init__r   c                 C     t | jjS r,   )r   rg   r2   r.   r0   r0   r1   r2         zChatKitWithRawResponse.sessionsr   c                 C  rl   r,   )r   rg   r4   r.   r0   r0   r1   r4      rm   zChatKitWithRawResponse.threadsNrd   r'   r*   re   )r*   r   )r*   r   r]   r^   r_   rj   r   r2   r4   r0   r0   r0   r1   r5          
r5   c                   @  rc   )ra   rd   r(   r*   re   c                 C  rf   r,   )rg   r   async_to_raw_response_wrapperrZ   ri   r0   r0   r1   rj      rk   z$AsyncChatKitWithRawResponse.__init__r   c                 C  rl   r,   )r   rg   r2   r.   r0   r0   r1   r2      rm   z$AsyncChatKitWithRawResponse.sessionsr   c                 C  rl   r,   )r   rg   r4   r.   r0   r0   r1   r4      rm   z#AsyncChatKitWithRawResponse.threadsNrd   r(   r*   re   )r*   r   )r*   r   ro   r0   r0   r0   r1   ra      rp   ra   c                   @  rc   )r:   rd   r'   r*   re   c                 C     || _ t|j| _d S r,   )rg   r"   rZ   ri   r0   r0   r1   rj         
z%ChatKitWithStreamingResponse.__init__r   c                 C  rl   r,   )r   rg   r2   r.   r0   r0   r1   r2      rm   z%ChatKitWithStreamingResponse.sessionsr   c                 C  rl   r,   )r   rg   r4   r.   r0   r0   r1   r4      rm   z$ChatKitWithStreamingResponse.threadsNrn   )r*   r   )r*   r   ro   r0   r0   r0   r1   r:      rp   r:   c                   @  rc   )rb   rd   r(   r*   re   c                 C  rs   r,   )rg   r#   rZ   ri   r0   r0   r1   rj      rt   z*AsyncChatKitWithStreamingResponse.__init__r   c                 C  rl   r,   )r   rg   r2   r.   r0   r0   r1   r2      rm   z*AsyncChatKitWithStreamingResponse.sessionsr   c                 C  rl   r,   )r   rg   r4   r.   r0   r0   r1   r4     rm   z)AsyncChatKitWithStreamingResponse.threadsNrr   )r*   r   )r*   r   ro   r0   r0   r0   r1   rb      rp   rb   )8
__future__r   typingr   r   r   httpx r   r4   r	   r
   r   r   r   r   r2   r   r   r   r   r   r   _typesr   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer    r!   	_responser"   r#   
types.betar$   _base_clientr%   'types.beta.chatkit_upload_file_responser&   __all__r'   r(   r5   ra   r:   rb   r0   r0   r0   r1   <module>   s*      NN