o
    $i=.                     @  sH  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 deZ'G dd deZ(G dd dZ)G dd dZ*G dd dZ+G dd dZ,dS )    )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                   @  Z   e Zd Zed#ddZed$ddZeeeddded	d%ddZdddedd&d!d"Z	dS )'r   returnSessionsWithRawResponsec                 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#   f/var/www/html/flask_server/venv/lib/python3.10/site-packages/openai/resources/beta/chatkit/sessions.pywith_raw_response      zSessions.with_raw_responseSessionsWithStreamingResponsec                 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 Sessions.with_streaming_responseNchatkit_configurationexpires_afterrate_limitsextra_headersextra_query
extra_bodytimeoutuserstrworkflowr   r,   +ChatSessionChatKitConfigurationParam | Omitr-   #ChatSessionExpiresAfterParam | Omitr.   !ChatSessionRateLimitsParam | Omitr/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGivenr   c       	   
   	   C  sB   ddi|pi }| j dt|||||dtjt||||	dtd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r3   r5   r,   r-   r.   r/   r0   r1   r2   bodyoptionscast_to)_postr   r   SessionCreateParamsr   r   
r"   r3   r5   r,   r-   r.   r/   r0   r1   r2   r#   r#   r$   create2   s"   '
zSessions.createrB   
session_idc                C  sF   |s	t d|ddi|pi }| jd| dt||||dtd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 r>   r?   /chatkit/sessions//cancelrB   rE   rF   
ValueErrorrG   r   r   r"   rK   r/   r0   r1   r2   r#   r#   r$   cancell   s   
zSessions.cancel)r   r   )r   r'   r3   r4   r5   r   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r   r   rK   r4   r/   r9   r0   r:   r1   r;   r2   r<   r   r   
__name__
__module____qualname__r   r%   r)   r
   r   rJ   rT   r#   r#   r#   r$   r      $    	@c                   @  r   )'r   r   AsyncSessionsWithRawResponsec                 C  r   r    )r\   r!   r#   r#   r$   r%      r&   zAsyncSessions.with_raw_response"AsyncSessionsWithStreamingResponsec                 C  r   r(   )r]   r!   r#   r#   r$   r)      r*   z%AsyncSessions.with_streaming_responseNr+   r3   r4   r5   r   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r   c       	   
   	     sP   ddi|pi }| j dt|||||dtjI dH t||||	dtdI dH S )r=   r>   r?   r@   rA   NrB   rC   )rG   r   r   rH   r   r   rI   r#   r#   r$   rJ      s$   '
zAsyncSessions.createrB   rK   c                  sN   |s
t d|ddi|pi }| jd| dt||||dtdI dH S )	rL   rM   r>   r?   rN   rO   rB   rP   NrQ   rS   r#   r#   r$   rT      s   
zAsyncSessions.cancel)r   r\   )r   r]   rU   rV   rW   r#   r#   r#   r$   r      r[   c                   @     e Zd ZdddZdS )	r   sessionsr   r   Nonec                 C  &   || _ t|j| _t|j| _d S N)	_sessionsr   to_raw_response_wrapperrJ   rT   r"   r_   r#   r#   r$   __init__     
z SessionsWithRawResponse.__init__Nr_   r   r   r`   rX   rY   rZ   rf   r#   r#   r#   r$   r          r   c                   @  r^   )	r\   r_   r   r   r`   c                 C  ra   rb   )rc   r   async_to_raw_response_wrapperrJ   rT   re   r#   r#   r$   rf     rg   z%AsyncSessionsWithRawResponse.__init__Nr_   r   r   r`   ri   r#   r#   r#   r$   r\     rj   r\   c                   @  r^   )	r'   r_   r   r   r`   c                 C  "   || _ t|j| _t|j| _d S rb   )rc   r   rJ   rT   re   r#   r#   r$   rf        
z&SessionsWithStreamingResponse.__init__Nrh   ri   r#   r#   r#   r$   r'     rj   r'   c                   @  r^   )	r]   r_   r   r   r`   c                 C  rm   rb   )rc   r   rJ   rT   re   r#   r#   r$   rf   %  rn   z+AsyncSessionsWithStreamingResponse.__init__Nrl   ri   r#   r#   r#   r$   r]   $  rj   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]   r#   r#   r#   r$   <module>   s,   $qq