o
    ùT·j1  ã                   @  s(  d dl mZ 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mZ ddlmZ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 )é    )Úannotations)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)Úturn_list_params)ÚTurnÚTurnsÚ
AsyncTurnsc                   @  óZ   e Zd Zed"dd„ƒZed#dd„ƒZddded	œd$dd„Zeeedddedœd%d d!„Z	dS )&r   ÚreturnÚTurnsWithRawResponsec                 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#   ún/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/beta/agents/sessions/turns.pyÚwith_raw_response   ó   zTurns.with_raw_responseÚTurnsWithStreamingResponsec                 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Turns.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚturn_idÚstrÚ
session_idr,   úHeaders | Noner-   úQuery | Noner.   úBody | Noner/   ú(float | httpx2.Timeout | None | NotGivenr   c             	   C  s`   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�S )á1  Retrieves a turn's current status, timestamps, usage, and error.

        Returns 404 if
        the turn does not belong to the session. See
        [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).

        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 ú6Expected a non-empty value for `turn_id` but received úOpenAI-Betaú	agents=v1ú-/agents/sessions/{session_id}/turns/{turn_id}©r2   r0   Úbearer_authT©r,   r-   r.   r/   Úsecurity©ÚoptionsÚcast_to©Ú
ValueErrorÚ_getr   r   r   ©r"   r0   r2   r,   r-   r.   r/   r#   r#   r$   Úretrieve+   s    û÷zTurns.retrieve©ÚafterÚlimitÚorderr,   r-   r.   r/   rJ   ú
str | OmitrK   ú
int | OmitrL   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[Turn]c          	      C  ód   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�tt t||||t|||dœtjƒddid	�td
�S ©a˜  Lists turns by creation time and turn ID.

        The after cursor is exclusive in the
        selected order. See
        [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).

        Args:
          after: Return resources after this resource ID in the selected order.

          limit: The maximum number of resources to return, between 1 and 100. Defaults to 20.

          order: The order in which resources are returned. Defaults to `desc`.

              - `asc` - Returns resources in ascending order.
              - `desc` - Returns resources in descending order.

          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
        r8   r:   r;   z#/agents/sessions/{session_id}/turns)r2   )rJ   rK   rL   r>   T)r,   r-   r.   r/   Úqueryr@   )ÚpagerB   Úmodel)	rE   Ú_get_api_listr   r   r   r   r   r   ÚTurnListParams©	r"   r2   rJ   rK   rL   r,   r-   r.   r/   r#   r#   r$   ÚlistW   ó,   &
ýúóîz
Turns.list)r   r   )r   r'   ©r0   r1   r2   r1   r,   r3   r-   r4   r.   r5   r/   r6   r   r   )r2   r1   rJ   rM   rK   rN   rL   rO   r,   r3   r-   r4   r.   r5   r/   r6   r   rP   ©
Ú__name__Ú
__module__Ú__qualname__r   r%   r)   r   rH   r   rY   r#   r#   r#   r$   r      ó$    	ö0ôc                   @  r   )&r   r   ÚAsyncTurnsWithRawResponsec                 C  r   r    )ra   r!   r#   r#   r$   r%   —   r&   zAsyncTurns.with_raw_responseÚAsyncTurnsWithStreamingResponsec                 C  r   r(   )rb   r!   r#   r#   r$   r)   ¡   r*   z"AsyncTurns.with_streaming_responseNr+   r0   r1   r2   r,   r3   r-   r4   r.   r5   r/   r6   r   c             	   Ã  sh   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�I dH S )r7   r8   r9   r:   r;   r<   r=   r>   Tr?   rA   NrD   rG   r#   r#   r$   rH   ª   s"   €û÷zAsyncTurns.retrieverI   rJ   rM   rK   rN   rL   rO   ú+AsyncPaginator[Turn, AsyncCursorPage[Turn]]c          	      C  rQ   rR   )	rE   rV   r   r   r   r   r   r   rW   rX   r#   r#   r$   rY   Ö   rZ   zAsyncTurns.list)r   ra   )r   rb   r[   )r2   r1   rJ   rM   rK   rN   rL   rO   r,   r3   r-   r4   r.   r5   r/   r6   r   rc   r\   r#   r#   r#   r$   r   –   r`   c                   @  ó   e Zd Zddd„ZdS )	r   Úturnsr   r   ÚNonec                 C  ó&   || _ t |j¡| _t |j¡| _d S ©N)Ú_turnsr   Úto_raw_response_wrapperrH   rY   ©r"   re   r#   r#   r$   Ú__init__  ó   ÿ
ÿzTurnsWithRawResponse.__init__N©re   r   r   rf   ©r]   r^   r_   rl   r#   r#   r#   r$   r     ó    r   c                   @  rd   )	ra   re   r   r   rf   c                 C  rg   rh   )ri   r   Úasync_to_raw_response_wrapperrH   rY   rk   r#   r#   r$   rl   "  rm   z"AsyncTurnsWithRawResponse.__init__N©re   r   r   rf   ro   r#   r#   r#   r$   ra   !  rp   ra   c                   @  rd   )	r'   re   r   r   rf   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S rh   )ri   r   rH   rY   rk   r#   r#   r$   rl   .  ó   ÿ
ÿz#TurnsWithStreamingResponse.__init__Nrn   ro   r#   r#   r#   r$   r'   -  rp   r'   c                   @  rd   )	rb   re   r   r   rf   c                 C  rs   rh   )ri   r   rH   rY   rk   r#   r#   r$   rl   :  rt   z(AsyncTurnsWithStreamingResponse.__init__Nrr   ro   r#   r#   r#   r$   rb   9  rp   rb   )+Ú
__future__r   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr   r   r   r	   r
   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.agents.sessionsr   Útypes.beta.agents.sessions.turnr   Ú__all__r   r   r   ra   r'   rb   r#   r#   r#   r$   Ú<module>   s(   $