o
    ¨Ýjí!  ã                   @  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)Útrace_list_params)ÚSessionTraceÚTracesÚAsyncTracesc                   @  óD   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S ) r   ÚreturnÚTracesWithRawResponsec                 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#   úg/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/beta/agents/sessions/traces.pyÚwith_raw_response   ó   zTraces.with_raw_responseÚTracesWithStreamingResponsec                 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Traces.with_streaming_responseN©ÚafterÚlimitÚorderÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚ
session_idÚstrr,   ú
str | Omitr-   ú
int | Omitr.   úLiteral['asc', 'desc'] | Omitr/   úHeaders | Noner0   úQuery | Noner1   úBody | Noner2   ú(float | httpx2.Timeout | None | NotGivenúSyncCursorPage[SessionTrace]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 published root-turn traces as OTLP JSON, ordered by turn creation time and
        ID. Unpublished traces are skipped. Each page returns data available when read;
        it does not wait for late traces. Trace reads and the JSON response are limited
        to 16 MiB per request. If the limit is exceeded, request fewer traces.

        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
        z9Expected a non-empty value for `session_id` but received zOpenAI-Betaz	agents=v1z$/agents/sessions/{session_id}/traces)r3   )r,   r-   r.   Zbearer_authT)r/   r0   r1   r2   ÚqueryÚsecurity)ÚpageÚoptionsÚmodel)	Ú
ValueErrorÚ_get_api_listr   r   r   r   r   r   ÚTraceListParams©	r"   r3   r,   r-   r.   r/   r0   r1   r2   r#   r#   r$   Úlist+   ó,   &
ýúóîzTraces.list)r   r   )r   r'   )r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   r<   ©	Ú__name__Ú
__module__Ú__qualname__r   r%   r)   r   r   rH   r#   r#   r#   r$   r      ó    	ôc                   @  r   ) r   r   ÚAsyncTracesWithRawResponsec                 C  r   r    )rO   r!   r#   r#   r$   r%   k   r&   zAsyncTraces.with_raw_responseÚ AsyncTracesWithStreamingResponsec                 C  r   r(   )rP   r!   r#   r#   r$   r)   u   r*   z#AsyncTraces.with_streaming_responseNr+   r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   ú;AsyncPaginator[SessionTrace, AsyncCursorPage[SessionTrace]]c          	      C  r=   r>   )	rD   rE   r   r   r   r   r   r   rF   rG   r#   r#   r$   rH   ~   rI   zAsyncTraces.list)r   rO   )r   rP   )r3   r4   r,   r5   r-   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   rQ   rJ   r#   r#   r#   r$   r   j   rN   c                   @  ó   e Zd Zddd„ZdS )	r   Útracesr   r   ÚNonec                 C  ó   || _ t |j¡| _d S ©N)Ú_tracesr   Zto_raw_response_wrapperrH   ©r"   rS   r#   r#   r$   Ú__init__¾   ó   
ÿzTracesWithRawResponse.__init__N©rS   r   r   rT   ©rK   rL   rM   rY   r#   r#   r#   r$   r   ½   ó    r   c                   @  rR   )	rO   rS   r   r   rT   c                 C  rU   rV   )rW   r   Zasync_to_raw_response_wrapperrH   rX   r#   r#   r$   rY   Ç   rZ   z#AsyncTracesWithRawResponse.__init__N©rS   r   r   rT   r\   r#   r#   r#   r$   rO   Æ   r]   rO   c                   @  rR   )	r'   rS   r   r   rT   c                 C  ó   || _ t|jƒ| _d S rV   )rW   r   rH   rX   r#   r#   r$   rY   Ð   ó   
ÿz$TracesWithStreamingResponse.__init__Nr[   r\   r#   r#   r#   r$   r'   Ï   r]   r'   c                   @  rR   )	rP   rS   r   r   rT   c                 C  r_   rV   )rW   r   rH   rX   r#   r#   r$   rY   Ù   r`   z)AsyncTracesWithStreamingResponse.__init__Nr^   r\   r#   r#   r#   r$   rP   Ø   r]   rP   )+Ú
__future__r   Ztyping_extensionsr   Zhttpx2Ú r   Ú_typesr   r   r   r	   r
   r   r   Z_utilsr   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.agents.sessionsr   Z(types.beta.agents.sessions.session_tracer   Ú__all__r   r   r   rO   r'   rP   r#   r#   r#   r$   Ú<module>   s(   $SS			