o
    ØRWj1  ã                   @  sL  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„ 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)Ú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                   @  ó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$   úu/home/esfera/Documents/content_generation/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 | Omitr0   úHeaders | Noner1   úQuery | Noner2   úBody | Noner3   ú'float | httpx.Timeout | None | NotGivenr   c       	   
   
   C  sH   ddi|pi ¥}| j dt|||||dœtjƒt||||	ddid�td�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   r$   r$   r%   Úcreate2   s*   'ûø
ûízSessions.create©r0   r1   r2   r3   Ú
session_idc             	   C  sL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�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?   r@   ú%/chatkit/sessions/{session_id}/cancel©rO   rC   TrD   ©rH   rI   ©Ú
ValueErrorrJ   r   r   r   ©r#   rO   r0   r1   r2   r3   r$   r$   r%   Úcancelp   s   
û÷zSessions.cancel)r   r   )r   r(   ©r4   r5   r6   r   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r3   r=   r   r   ©rO   r5   r0   r:   r1   r;   r2   r<   r3   r=   r   r   ©
Ú__name__Ú
__module__Ú__qualname__r   r&   r*   r
   r   rM   rX   r$   r$   r$   r%   r      ó$    	óD÷c                   @  r   )'r   r   ÚAsyncSessionsWithRawResponsec                 C  r    r!   )r`   r"   r$   r$   r%   r&   š   r'   zAsyncSessions.with_raw_responseÚ"AsyncSessionsWithStreamingResponsec                 C  r    r)   )ra   r"   r$   r$   r%   r*   ¤   r+   z%AsyncSessions.with_streaming_responseNr,   r4   r5   r6   r   r-   r7   r.   r8   r/   r9   r0   r:   r1   r;   r2   r<   r3   r=   r   c       	   
   
   Ã  sV   �ddi|pi ¥}| j dt|||||dœtjƒI dH t||||	ddid�td	�I dH S )
r>   r?   r@   rA   rB   NrC   TrD   rF   )rJ   r   r   rK   r   r   rL   r$   r$   r%   rM   ­   s,   €'ûø
ûízAsyncSessions.createrN   rO   c             	   Ã  sT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )rP   rQ   r?   r@   rR   rS   rC   TrD   rT   NrU   rW   r$   r$   r%   rX   ë   s   €
û÷zAsyncSessions.cancel)r   r`   )r   ra   rY   rZ   r[   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_wrapperrM   rX   ©r#   rc   r$   r$   r%   Ú__init__  ó   ÿ
ÿz SessionsWithRawResponse.__init__N©rc   r   r   rd   ©r\   r]   r^   rj   r$   r$   r$   r%   r     ó    r   c                   @  rb   )	r`   rc   r   r   rd   c                 C  re   rf   )rg   r   Úasync_to_raw_response_wrapperrM   rX   ri   r$   r$   r%   rj   !  rk   z%AsyncSessionsWithRawResponse.__init__N©rc   r   r   rd   rm   r$   r$   r$   r%   r`      rn   r`   c                   @  rb   )	r(   rc   r   r   rd   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S rf   )rg   r   rM   rX   ri   r$   r$   r%   rj   -  ó   ÿ
ÿz&SessionsWithStreamingResponse.__init__Nrl   rm   r$   r$   r$   r%   r(   ,  rn   r(   c                   @  rb   )	ra   rc   r   r   rd   c                 C  rq   rf   )rg   r   rM   rX   ri   r$   r$   r%   rj   9  rr   z+AsyncSessionsWithStreamingResponse.__init__Nrp   rm   r$   r$   r$   r%   ra   8  rn   ra   ).Ú
__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_paramÚ1types.beta.chatkit.chat_session_rate_limits_paramÚ3types.beta.chatkit.chat_session_expires_after_paramÚ;types.beta.chatkit.chat_session_chatkit_configuration_paramÚ__all__r   r   r   r`   r(   ra   r$   r$   r$   r%   Ú<module>   s,   ${{