
    i1                       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/piyush/.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	          ||||	ddi          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/   bearer_authTr0   r1   r2   r3   security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	 	 )+'%'.    '  
 
 	
r'   r0   r1   r2   r3   
session_idc                   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          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rP   rD   TrE   rI   rJ   
ValueErrorrK   r   r   r   r$   rP   r0   r1   r2   r3   s         r%   cancelzSessions.cancelp   s    2  	igYcgghhh&(9Sm>QrSzzAjYYY(+'%'.      

 

 
	
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   rP   r5   r0   r:   r1   r;   r2   r<   r3   r=   r   r   
__name__
__module____qualname__r   r&   r+   r   r   rN   rZ    r'   r%   r   r      s        - - - _- 3 3 3 _3 NR=A9= )-$("&;D<
 <
 <
 <
 <
 <
H )-$("&;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"   )rc   r#   s    r%   r&   zAsyncSessions.with_raw_response   s     ,D111r'   "AsyncSessionsWithStreamingResponsec                     t          |           S r*   )re   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	          ||||	ddi          t
          	           d{V S )
r?   r@   rA   rB   rC   NrD   TrE   rG   )rK   r   r   rL   r   r   rM   s
             r%   rN   zAsyncSessions.create   s      N '(9Sm>QrSZZ,  (-B%2#.  &9	 	 	 	 	 	 	 	 )+'%'.    '   
 
 
 
 
 
 
 
 	
r'   rO   rP   c                  K   |st          d|          ddi|pi }|                     t          d|          t          ||||ddi          t          	           d
{V S )rR   rS   r@   rA   rT   rU   rD   TrE   rV   NrW   rY   s         r%   rZ   zAsyncSessions.cancel   s      2  	igYcgghhh&(9Sm>QrSZZAjYYY(+'%'.       

 

 

 

 

 

 

 

 
	
r'   )r   rc   )r   re   r[   r\   r]   ra   r'   r%   r   r      s        2 2 2 _2 8 8 8 _8 NR=A9= )-$("&;D<
 <
 <
 <
 <
 <
H )-$("&;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_wrapperrN   rZ   r$   rj   s     r%   __init__z SessionsWithRawResponse.__init__  sA    !&>O
 
 '>O
 
r'   Nrj   r   r   rk   r^   r_   r`   rq   ra   r'   r%   r    r      (        
 
 
 
 
 
r'   r    c                      e Zd ZddZdS )rc   rj   r   r   rk   c                    || _         t          j        |j                  | _        t          j        |j                  | _        d S rm   )rn   r   async_to_raw_response_wrapperrN   rZ   rp   s     r%   rq   z%AsyncSessionsWithRawResponse.__init__!  sA    !&DO
 
 'DO
 
r'   Nrj   r   r   rk   rs   ra   r'   r%   rc   rc      rt   r'   rc   c                      e Zd ZddZdS )r(   rj   r   r   rk   c                x    || _         t          |j                  | _        t          |j                  | _        d S rm   )rn   r   rN   rZ   rp   s     r%   rq   z&SessionsWithStreamingResponse.__init__-  s;    !2O
 
 3O
 
r'   Nrr   rs   ra   r'   r%   r(   r(   ,  rt   r'   r(   c                      e Zd ZddZdS )re   rj   r   r   rk   c                x    || _         t          |j                  | _        t          |j                  | _        d S rm   )rn   r   rN   rZ   rp   s     r%   rq   z+AsyncSessionsWithStreamingResponse.__init__9  s;    !8O
 
 9O
 
r'   Nrx   rs   ra   r'   r%   re   re   8  rt   r'   re   ).
__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    rc   r(   re   ra   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
'x
 x
 x
 x
 x
 x
 x
 x
vx
 x
 x
 x
 x
$ x
 x
 x
v	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
r'   