
    i/                       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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mZmZmZm Z  ddl!m"Z" ddl#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          Z+ G d d          Z, G d d          Z-dS )    )annotationsN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)ChatSessionWorkflowParamChatSessionRateLimitsParamChatSessionExpiresAfterParam$ChatSessionChatKitConfigurationParamsession_create_params)ChatSession)r   )r   )r   )r   SessionsAsyncSessionsc                  l    e Zd Zedd            Zed d            Zeeedddedd!dZdddedd"dZ	dS )#r   returnSessionsWithRawResponsec                     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    m/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/openai/resources/beta/chatkit/sessions.pywith_raw_responsezSessions.with_raw_response   s     't,,,    SessionsWithStreamingResponsec                     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 Sessions.with_streaming_response)   s     -T222r'   Nchatkit_configurationexpires_afterrate_limitsextra_headersextra_query
extra_bodytimeoutuserstrworkflowr   r-   +ChatSessionChatKitConfigurationParam | Omitr.   #ChatSessionExpiresAfterParam | Omitr/   !ChatSessionRateLimitsParam | Omitr0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGivenr   c       	            ddi|pi }|                      dt          |||||dt          j                  t	          ||||	          t
                    S )u  
        Create a ChatKit session.

        Args:
          user: A free-form string that identifies your end user; ensures this Session can
              access other objects that have the same `user` scope.

          workflow: Workflow that powers the session.

          chatkit_configuration: Optional overrides for ChatKit runtime configuration features

          expires_after: Optional override for session expiration timing in seconds from creation.
              Defaults to 10 minutes.

          rate_limits: Optional override for per-minute request limits. When omitted, defaults to 10.

          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=v1/chatkit/sessionsr4   r6   r-   r.   r/   r0   r1   r2   r3   bodyoptionscast_to)_postr   r   SessionCreateParamsr   r   
r$   r4   r6   r-   r.   r/   r0   r1   r2   r3   s
             r%   createzSessions.create2   s    N '(9Sm>QrSzz   (-B%2#.  &9	 	 )+Q[el      
 
 	
r'   rD   
session_idc          	         |st          d|          ddi|pi }|                     t          d|          t          ||||          t                    S )  
        Cancel an active ChatKit session and return its most recent metadata.

        Cancelling prevents new requests from using the issued client secret.

        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
        9Expected a non-empty value for `session_id` but received r@   rA   %/chatkit/sessions/{session_id}/cancelrM   rD   rG   rH   
ValueErrorrI   r   r   r   r$   rM   r0   r1   r2   r3   s         r%   cancelzSessions.cancell   s    2  	igYcgghhh&(9Sm>QrSzzAjYYY(+Q[el      
 
 	
r'   )r   r    )r   r(   r4   r5   r6   r   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r3   r=   r   r   rM   r5   r0   r:   r1   r;   r2   r<   r3   r=   r   r   
__name__
__module____qualname__r   r&   r+   r   r   rL   rW    r'   r%   r   r      s        - - - _- 3 3 3 _3 NR=A9= )-$("&;D8
 8
 8
 8
 8
 8
@ )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r'   c                  l    e Zd Zedd            Zed d            Zeeedddedd!dZdddedd"dZ	dS )#r   r   AsyncSessionsWithRawResponsec                     t          |           S r"   )r`   r#   s    r%   r&   zAsyncSessions.with_raw_response   s     ,D111r'   "AsyncSessionsWithStreamingResponsec                     t          |           S r*   )rb   r#   s    r%   r+   z%AsyncSessions.with_streaming_response   s     2$777r'   Nr,   r4   r5   r6   r   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r3   r=   r   c       	           K   ddi|pi }|                      dt          |||||dt          j                   d{V t	          ||||	          t
                     d{V S )r?   r@   rA   rB   rC   NrD   rE   )rI   r   r   rJ   r   r   rK   s
             r%   rL   zAsyncSessions.create   s      N '(9Sm>QrSZZ,  (-B%2#.  &9	 	 	 	 	 	 	 	 )+Q[el       
 
 
 
 
 
 
 
 	
r'   rD   rM   c          	        K   |st          d|          ddi|pi }|                     t          d|          t          ||||          t                     d{V S )	rO   rP   r@   rA   rQ   rR   rD   rS   NrT   rV   s         r%   rW   zAsyncSessions.cancel   s      2  	igYcgghhh&(9Sm>QrSZZAjYYY(+Q[el       
 
 
 
 
 
 
 
 	
r'   )r   r`   )r   rb   rX   rY   rZ   r^   r'   r%   r   r      s        2 2 2 _2 8 8 8 _8 NR=A9= )-$("&;D8
 8
 8
 8
 8
 8
@ )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r'   c                      e Zd ZddZdS )r    sessionsr   r   Nonec                    || _         t          j        |j                  | _        t          j        |j                  | _        d S N)	_sessionsr   to_raw_response_wrapperrL   rW   r$   rg   s     r%   __init__z SessionsWithRawResponse.__init__  sA    !&>O
 
 '>O
 
r'   Nrg   r   r   rh   r[   r\   r]   rn   r^   r'   r%   r    r      (        
 
 
 
 
 
r'   r    c                      e Zd ZddZdS )r`   rg   r   r   rh   c                    || _         t          j        |j                  | _        t          j        |j                  | _        d S rj   )rk   r   async_to_raw_response_wrapperrL   rW   rm   s     r%   rn   z%AsyncSessionsWithRawResponse.__init__  sA    !&DO
 
 'DO
 
r'   Nrg   r   r   rh   rp   r^   r'   r%   r`   r`     rq   r'   r`   c                      e Zd ZddZdS )r(   rg   r   r   rh   c                x    || _         t          |j                  | _        t          |j                  | _        d S rj   )rk   r   rL   rW   rm   s     r%   rn   z&SessionsWithStreamingResponse.__init__  s;    !2O
 
 3O
 
r'   Nro   rp   r^   r'   r%   r(   r(     rq   r'   r(   c                      e Zd ZddZdS )rb   rg   r   r   rh   c                x    || _         t          |j                  | _        t          |j                  | _        d S rj   )rk   r   rL   rW   rm   s     r%   rn   z+AsyncSessionsWithStreamingResponse.__init__)  s;    !8O
 
 9O
 
r'   Nru   rp   r^   r'   r%   rb   rb   (  rq   r'   rb   ).
__future__r   httpx r   _typesr   r   r   r	   r
   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   _base_clientr   types.beta.chatkitr   r   r   r   r   types.beta.chatkit.chat_sessionr   .types.beta.chatkit.chat_session_workflow_param1types.beta.chatkit.chat_session_rate_limits_param3types.beta.chatkit.chat_session_expires_after_param;types.beta.chatkit.chat_session_chatkit_configuration_param__all__r   r   r    r`   r(   rb   r^   r'   r%   <module>r      s   # " " " " "  ! ! ! ! ! ! L L L L L L L L L L L L L L L L L L L L L L L L L L L L ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z 1 1 1 1 1 1              < ; ; ; ; ; W W W W W W \ \ \ \ \ \ ` ` ` ` ` ` p p p p p p
'p
 p
 p
 p
 p
 p
 p
 p
fp
 p
 p
 p
 p
$ p
 p
 p
f	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
r'   