
    Kh=.                    l   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 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,y)    )annotationsN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)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                      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	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
        )SessionsWithRawResponseselfs    Y/var/www/html/venv/lib/python3.12/site-packages/openai/resources/beta/chatkit/sessions.pywith_raw_responsezSessions.with_raw_response   s     't,,    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
        )SessionsWithStreamingResponser!   s    r#   with_streaming_responsez Sessions.with_streaming_response)   s     -T22r%   Nchatkit_configurationexpires_afterrate_limitsextra_headersextra_query
extra_bodytimeoutc       	            ddi|xs i }| j                  dt        |||||dt        j                        t	        ||||	      t
              S )t  
        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userworkflowr+   r,   r-   r.   r/   r0   r1   bodyoptionscast_to)_postr   r   SessionCreateParamsr   r   
r"   r8   r9   r+   r,   r-   r.   r/   r0   r1   s
             r#   createzSessions.create2   st    N '(9Sm>QrSzz   (-B%2#. &99	 )+Q[el    
 	
r%   r:   c          	         |st        d|      ddi|xs i }| j                  d| dt        ||||      t              S )L  
        Cancel a ChatKit session

        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 r4   r5   /chatkit/sessions//cancelr:   r=   r>   
ValueErrorr?   r   r   r"   
session_idr.   r/   r0   r1   s         r#   cancelzSessions.cancell   sk    . XYcXfghh&(9Sm>QrSzz G4(+Q[el    
 	
r%   )returnr    )rN   r(   r8   strr9   r   r+   z+ChatSessionChatKitConfigurationParam | Omitr,   z#ChatSessionExpiresAfterParam | Omitr-   z!ChatSessionRateLimitsParam | Omitr.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGivenrN   r   rL   rP   r.   rQ   r/   rR   r0   rS   r1   rT   rN   r   
__name__
__module____qualname__r   r$   r)   r   r   rB   rM    r%   r#   r   r      s    - - 3 3 NR=A9= )-$("&;D8
 8
 +	8

  K8
 ;8
 78
 &8
 "8
  8
 98
 
8
@ )-$("&;D 
 
 & 
 " 
   
 9 
 
 
r%   c                      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	y)r   c                    t        |       S r   )AsyncSessionsWithRawResponser!   s    r#   r$   zAsyncSessions.with_raw_response   s     ,D11r%   c                    t        |       S r'   )"AsyncSessionsWithStreamingResponser!   s    r#   r)   z%AsyncSessions.with_streaming_response   s     2$77r%   Nr*   c       	           K   ddi|xs i }| j                  dt        |||||dt        j                         d{   t	        ||||	      t
               d{   S 7 $7 w)r3   r4   r5   r6   r7   Nr:   r;   )r?   r   r   r@   r   r   rA   s
             r#   rB   zAsyncSessions.create   s     N '(9Sm>QrSZZ,  (-B%2#. &99	 	 )+Q[el     
 
 	
	
s!   :A%A!
A%A#A%#A%r:   c          	        K   |st        d|      ddi|xs i }| j                  d| dt        ||||      t               d{   S 7 w)	rD   rE   r4   r5   rF   rG   r:   rH   NrI   rK   s         r#   rM   zAsyncSessions.cancel   sy     . XYcXfghh&(9Sm>QrSZZ G4(+Q[el     
 
 	
 
s   AA	A
A)rN   r]   )rN   r_   rO   rU   rV   rZ   r%   r#   r   r      s    2 2 8 8 NR=A9= )-$("&;D8
 8
 +	8

  K8
 ;8
 78
 &8
 "8
  8
 98
 
8
@ )-$("&;D 
 
 & 
 " 
   
 9 
 
 
r%   c                      e Zd ZddZy)r    c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y N)	_sessionsr   to_raw_response_wrapperrB   rM   r"   sessionss     r#   __init__z SessionsWithRawResponse.__init__  s=    !&>>OO
 '>>OO
r%   Nrh   r   rN   NonerW   rX   rY   ri   rZ   r%   r#   r    r           
r%   r    c                      e Zd ZddZy)r]   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        y rd   )re   r   async_to_raw_response_wrapperrB   rM   rg   s     r#   ri   z%AsyncSessionsWithRawResponse.__init__  s=    !&DDOO
 'DDOO
r%   Nrh   r   rN   rk   rl   rZ   r%   r#   r]   r]     rm   r%   r]   c                      e Zd ZddZy)r(   c                z    || _         t        |j                        | _        t        |j                        | _        y rd   )re   r   rB   rM   rg   s     r#   ri   z&SessionsWithStreamingResponse.__init__  s1    !2OO
 3OO
r%   Nrj   rl   rZ   r%   r#   r(   r(     rm   r%   r(   c                      e Zd ZddZy)r_   c                z    || _         t        |j                        | _        t        |j                        | _        y rd   )re   r   rB   rM   rg   s     r#   ri   z+AsyncSessionsWithStreamingResponse.__init__%  s1    !8OO
 9OO
r%   Nrq   rl   rZ   r%   r#   r_   r_   $  rm   r%   r_   )-
__future__r   httpx r   _typesr   r   r   r	   r
   r   r   _utilsr   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(   r_   rZ   r%   r#   <module>r      s    #  ! L L L = ' ; Z 1  < W \ ` p
'n
 n
bn
$ n
b	
 	
	
 	
	
 	
	
 	
r%   