§
    ~ŠtjÉY  ã                  ó²  — d dl mZ d dlmZmZ d dlmZ d dlmZ d dlZddl	m
Z
mZ ddlmZmZmZmZmZmZmZmZ dd	lmZ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!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- ddl.m/Z/ ddgZ0 G d„ de¦  «        Z1 G d„ de¦  «        Z2 G d„ d¦  «        Z3 G d„ d¦  «        Z4 G d„ d¦  «        Z5 G d„ d¦  «        Z6dS )é    )Úannotations)ÚListÚUnion)Údatetime)ÚLiteralNé   )Útrace_query_paramsÚtrace_list_runs_params)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚSequenceNotStrÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚstrip_not_givenÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_raw_response_wrapperÚto_streamed_response_wrapperÚasync_to_raw_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncItemsCursorPostPaginationÚAsyncItemsCursorPostPagination)ÚTrace)ÚAsyncPaginatorÚmake_request_options)ÚRunSelectField)ÚTraceListRunsResponseÚTracesResourceÚAsyncTracesResourcec                  ó‚   — e Zd Zed(d„¦   «         Zed)d„¦   «         Zeeeeedddedœ	d*d„Zeeeeeeeeedddedœd+d'„Z	dS ),r%   ÚreturnÚTracesResourceWithRawResponsec                ó    — t          | ¦  «        S ©z™
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.
        )r)   ©Úselfs    úh/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langsmith/_openapi_client/resources/traces.pyÚwith_raw_responsez TracesResource.with_raw_response    s   € õ -¨TÑ2Ô2Ð2ó    Ú#TracesResourceWithStreamingResponsec                ó    — t          | ¦  «        S ©ze
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.
        )r1   r,   s    r.   Úwith_streaming_responsez&TracesResource.with_streaming_response(   s   € õ
 3°4Ñ8Ô8Ð8r0   N©	ÚfilterÚmax_start_timeÚmin_start_timeÚselectsÚacceptÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚtrace_idÚstrÚ
project_idr6   ú
str | Omitr7   úUnion[str, datetime] | Omitr8   r9   áÙ  List[Literal['ID', 'NAME', 'RUN_TYPE', 'STATUS', 'START_TIME', 'END_TIME', 'LATENCY_SECONDS', 'FIRST_TOKEN_TIME', 'ERROR', 'ERROR_PREVIEW', 'EXTRA', 'METADATA', 'EVENTS', 'INPUTS', 'INPUTS_PREVIEW', 'OUTPUTS', 'OUTPUTS_PREVIEW', 'MANIFEST', 'PARENT_RUN_IDS', 'PROJECT_ID', 'TRACE_ID', 'THREAD_ID', 'DOTTED_ORDER', 'IS_ROOT', 'REFERENCE_EXAMPLE_ID', 'REFERENCE_DATASET_ID', 'TOTAL_TOKENS', 'PROMPT_TOKENS', 'COMPLETION_TOKENS', 'TOTAL_COST', 'PROMPT_COST', 'COMPLETION_COST', 'PROMPT_TOKEN_DETAILS', 'COMPLETION_TOKEN_DETAILS', 'PROMPT_COST_DETAILS', 'COMPLETION_COST_DETAILS', 'PRICE_MODEL_ID', 'TAGS', 'APP_PATH', 'ATTACHMENTS', 'THREAD_EVALUATION_TIME', 'IS_IN_DATASET', 'LAST_QUEUED_AT', 'SHARE_URL', 'FEEDBACK_STATS']] | Omitr:   r;   úHeaders | Noner<   úQuery | Noner=   úBody | Noner>   ú'float | httpx.Timeout | None | NotGivenr$   c       
        ó  — |st          d|›�¦  «        ‚i t          d|i¦  «        ¥|pi ¥}|                      t          d|¬¦  «        t	          ||	|
|t          |||||dœt          j        ¦  «        ¬¦  «        t          ¬¦  «        S )á$  Returns runs for a trace ID within min/max start time.

        Optional `filter`;
        repeatable `selects` to select fields to return.

        Self-hosted deployments require LangSmith `v0.16` or later.

        Args:
          project_id: `project_id` is the UUID of the tracing project that owns the trace.

          filter: `filter` narrows which runs within this trace are returned, using a LangSmith
              filter expression evaluated against each run. For example: `eq(run_type, "llm")`
              for LLM runs only, or `eq(status, "error")` for failed runs. See
              https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
              for syntax.

          max_start_time: `max_start_time` is the optional inclusive upper bound for run `start_time`
              (RFC3339 date-time). Required together with `min_start_time`.

          min_start_time: `min_start_time` is the optional inclusive lower bound for run `start_time`
              (RFC3339 date-time). Required together with `max_start_time`.

          selects: `selects` lists which properties to include on each returned run (repeatable
              query parameter). Accepts any value of the `RunSelectField` enum. If omitted,
              only `id` is returned.

          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
        ú7Expected a non-empty value for `trace_id` but received ÚAcceptú/api/v2/traces/{trace_id}/runs©r?   ©rA   r6   r7   r8   r9   ©r;   r<   r=   r>   Úquery©ÚoptionsÚcast_to)	Ú
ValueErrorr   Ú_getr   r"   r   r
   ÚTraceListRunsParamsr$   ©r-   r?   rA   r6   r7   r8   r9   r:   r;   r<   r=   r>   s               r.   Ú	list_runszTracesResource.list_runs/   sÅ   € ðH ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØX�?¨H°fÐ+=Ñ>Ô>ÐXÀ=ÐCVÐTVÐXˆØ�yŠyÝÐ:ÀXÐNÑNÔNÝ(Ø+Ø'Ø%ØÝ%à&0Ø"(Ø*8Ø*8Ø#*ðð õ +Ô>ñ	ô 	ðñ ô õ  *ð% ñ 
ô 
ð 	
r0   ©Úcursorr7   r8   Ú	page_sizerA   r9   Útrace_filterÚ	trace_idsÚtree_filterr;   r<   r=   r>   r[   r\   ú
int | OmitúList[RunSelectField] | Omitr]   r^   úSequenceNotStr[str] | Omitr_   ú$SyncItemsCursorPostPagination[Trace]c               óÈ   — |                       dt          t                   t          |||||||||	dœ	t          j        ¦  «        t          |
|||¬¦  «        t          d¬¦  «        S ©ua  
        Returns a paginated list of traces (root runs) for a single tracing project.
        Each item carries the trace's root run plus optional trace-wide aggregates
        (`total_tokens`, `total_cost`, `first_token_time`) under `trace_aggregates`, so
        clients never have to merge by `trace_id`.

        Traces are scanned within a `start_time` window: `min_start_time` defaults to 24
        hours before the request, `max_start_time` defaults to the request time. Set
        either explicitly to widen or narrow the window.

        Supports filters (`trace_filter`, `tree_filter`), cursor pagination (`cursor`),
        and field projection (`selects`).

        Self-hosted deployments require LangSmith `v0.16` or later.

        Args:
          cursor: `cursor` is the opaque string returned in a previous response's `next_cursor`.

          max_start_time: `max_start_time` is the exclusive upper bound for the root-run start time scan
              (RFC3339). Defaults to the request time when omitted.

          min_start_time: `min_start_time` is the inclusive lower bound for the root-run start time scan
              (RFC3339). Defaults to 24 hours before the request when omitted.

          page_size: `page_size` is the maximum number of traces to return per page. Defaults to 20;
              must be between 1 and 100 when set.

          project_id: `project_id` is the UUID of the tracing project that owns the traces. Required.

          selects: `selects` lists which properties to include on each returned trace. Properties
              listed here are routed to the appropriate sub-object on each item:
              `total_tokens`, `total_cost`, and `first_token_time` appear under
              `trace_aggregates`; everything else appears under `root_run`. If omitted, only
              `id` is returned on `root_run`.

          trace_filter: `trace_filter` narrows results to traces whose root run matches this LangSmith
              filter expression. This filter targets root runs only â€” `is_root = true` is
              implied. See
              https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
              for syntax.

          trace_ids: `trace_ids` is an optional fast-path restriction to a known set of trace UUIDs.
              Equivalent in result to including each UUID in a `trace_filter`, but more
              efficient at scale.

          tree_filter: `tree_filter` narrows results to traces containing at least one run anywhere in
              the run tree (root or descendant) that matches this LangSmith filter expression.

          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
        z/api/v2/traces/query)	r[   r7   r8   r\   rA   r9   r]   r^   r_   )r;   r<   r=   r>   Úpost)ÚpageÚbodyrS   ÚmodelÚmethod)Ú_get_api_listr   r    r   r	   ÚTraceQueryParamsr"   ©r-   r[   r7   r8   r\   rA   r9   r]   r^   r_   r;   r<   r=   r>   s                 r.   rQ   zTracesResource.query«   sŽ   € ðV ×!Ò!Ø"Ý.­uÔ5Ý à$Ø&4Ø&4Ø!*Ø",Ø&Ø$0Ø!*Ø#.ð
ð 
õ #Ô3ñô õ )Ø+¸ÐQ[Ðelðñ ô õ Øð+ "ñ 
ô 
ð 	
r0   )r(   r)   )r(   r1   ©r?   r@   rA   r@   r6   rB   r7   rC   r8   rC   r9   rD   r:   rB   r;   rE   r<   rF   r=   rG   r>   rH   r(   r$   )r[   rB   r7   rC   r8   rC   r\   r`   rA   rB   r9   ra   r]   rB   r^   rb   r_   rB   r;   rE   r<   rF   r=   rG   r>   rH   r(   rc   ©
Ú__name__Ú
__module__Ú__qualname__r   r/   r4   r   r   rY   rQ   © r0   r.   r%   r%      së   € € € € € Øð3ð 3ð 3ñ „_ð3ð ð9ð 9ð 9ñ „_ð9ð "Ø6:Ø6:ðd Ø!ð )-Ø$(Ø"&Ø;DðAz
ð z
ð z
ð z
ð z
ð z
ð~ "Ø6:Ø6:Ø $Ø!%Ø/3Ø#'Ø04Ø"&ð )-Ø$(Ø"&Ø;Dð#a
ð a
ð a
ð a
ð a
ð a
ð a
ð a
r0   c                  ó‚   — e Zd Zed(d„¦   «         Zed)d„¦   «         Zeeeeedddedœ	d*d„Zeeeeeeeeedddedœd+d'„Z	dS ),r&   r(   Ú"AsyncTracesResourceWithRawResponsec                ó    — t          | ¦  «        S r+   )ru   r,   s    r.   r/   z%AsyncTracesResource.with_raw_response  s   € õ 2°$Ñ7Ô7Ð7r0   Ú(AsyncTracesResourceWithStreamingResponsec                ó    — t          | ¦  «        S r3   )rw   r,   s    r.   r4   z+AsyncTracesResource.with_streaming_response  s   € õ
 8¸Ñ=Ô=Ð=r0   Nr5   r?   r@   rA   r6   rB   r7   rC   r8   r9   rD   r:   r;   rE   r<   rF   r=   rG   r>   rH   r$   c       
      ƒ  ó,  K  — |st          d|›�¦  «        ‚i t          d|i¦  «        ¥|pi ¥}|                      t          d|¬¦  «        t	          ||	|
|t          |||||dœt          j        ¦  «        ƒ d{V —†¬¦  «        t          ¬¦  «        ƒ d{V —†S )	rJ   rK   rL   rM   rN   rO   NrP   rR   )	rU   r   rV   r   r"   r   r
   rW   r$   rX   s               r.   rY   zAsyncTracesResource.list_runs  s  è è € ðH ð 	eÝÐcÐW_ÐcÐcÑdÔdÐdØX�?¨H°fÐ+=Ñ>Ô>ÐXÀ=ÐCVÐTVÐXˆØ—Y’YÝÐ:ÀXÐNÑNÔNÝ(Ø+Ø'Ø%ØÝ1à&0Ø"(Ø*8Ø*8Ø#*ðð õ +Ô>ñ	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ðñ ô õ  *ð% ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r0   rZ   r[   r\   r`   ra   r]   r^   rb   r_   ú<AsyncPaginator[Trace, AsyncItemsCursorPostPagination[Trace]]c               óÈ   — |                       dt          t                   t          |||||||||	dœ	t          j        ¦  «        t          |
|||¬¦  «        t          d¬¦  «        S re   )rk   r   r    r   r	   rl   r"   rm   s                 r.   rQ   zAsyncTracesResource.query›  sŽ   € ðV ×!Ò!Ø"Ý/µÔ6Ý à$Ø&4Ø&4Ø!*Ø",Ø&Ø$0Ø!*Ø#.ð
ð 
õ #Ô3ñô õ )Ø+¸ÐQ[Ðelðñ ô õ Øð+ "ñ 
ô 
ð 	
r0   )r(   ru   )r(   rw   rn   )r[   rB   r7   rC   r8   rC   r\   r`   rA   rB   r9   ra   r]   rB   r^   rb   r_   rB   r;   rE   r<   rF   r=   rG   r>   rH   r(   rz   ro   rs   r0   r.   r&   r&     së   € € € € € Øð8ð 8ð 8ñ „_ð8ð ð>ð >ð >ñ „_ð>ð "Ø6:Ø6:ðd Ø!ð )-Ø$(Ø"&Ø;DðAz
ð z
ð z
ð z
ð z
ð z
ð~ "Ø6:Ø6:Ø $Ø!%Ø/3Ø#'Ø04Ø"&ð )-Ø$(Ø"&Ø;Dð#a
ð a
ð a
ð a
ð a
ð a
ð a
ð a
r0   c                  ó   — e Zd Zdd„ZdS )r)   Útracesr%   r(   ÚNonec                óx   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S ©N)Ú_tracesr   rY   rQ   ©r-   r}   s     r.   Ú__init__z&TracesResourceWithRawResponse.__init__   s<   € ØˆŒå0ØÔñ
ô 
ˆŒõ -ØŒLñ
ô 
ˆŒ
ˆ
ˆ
r0   N©r}   r%   r(   r~   ©rp   rq   rr   rƒ   rs   r0   r.   r)   r)   ÿ  ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r0   r)   c                  ó   — e Zd Zdd„ZdS )ru   r}   r&   r(   r~   c                óx   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S r€   )r�   r   rY   rQ   r‚   s     r.   rƒ   z+AsyncTracesResourceWithRawResponse.__init__  s<   € ØˆŒå6ØÔñ
ô 
ˆŒõ 3ØŒLñ
ô 
ˆŒ
ˆ
ˆ
r0   N©r}   r&   r(   r~   r…   rs   r0   r.   ru   ru     r†   r0   ru   c                  ó   — e Zd Zdd„ZdS )r1   r}   r%   r(   r~   c                óx   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S r€   )r�   r   rY   rQ   r‚   s     r.   rƒ   z,TracesResourceWithStreamingResponse.__init__  s<   € ØˆŒå5ØÔñ
ô 
ˆŒõ 2ØŒLñ
ô 
ˆŒ
ˆ
ˆ
r0   Nr„   r…   rs   r0   r.   r1   r1     r†   r0   r1   c                  ó   — e Zd Zdd„ZdS )rw   r}   r&   r(   r~   c                óx   — || _         t          |j        ¦  «        | _        t          |j        ¦  «        | _        d S r€   )r�   r   rY   rQ   r‚   s     r.   rƒ   z1AsyncTracesResourceWithStreamingResponse.__init__$  s<   € ØˆŒå;ØÔñ
ô 
ˆŒõ 8ØŒLñ
ô 
ˆŒ
ˆ
ˆ
r0   Nr‰   r…   rs   r0   r.   rw   rw   #  r†   r0   rw   )7Ú
__future__r   Útypingr   r   r   Útyping_extensionsr   ÚhttpxÚtypesr	   r
   Ú_typesr   r   r   r   r   r   r   r   Ú_utilsr   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   r   r   Ú
paginationr   r   Útypes.tracer    Ú_base_clientr!   r"   Útypes.run_select_fieldr#   Útypes.trace_list_runs_responser$   Ú__all__r%   r&   r)   ru   r1   rw   rs   r0   r.   ú<module>rž      sÁ  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %à €€€à >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ø ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZØ [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ð [Ø %Ð %Ð %Ð %Ð %Ð %Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9ðð ð ð ð ð ð ð ð ð ð ð ð WÐ VÐ VÐ VÐ VÐ VÐ VÐ VØ Ð Ð Ð Ð Ð Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø BÐ BÐ BÐ BÐ BÐ BàÐ2Ð
3€ðm
ð m
ð m
ð m
ð m
�_ñ m
ô m
ð m
ð`m
ð m
ð m
ð m
ð m
Ð*ñ m
ô m
ð m
ð`	
ð 	
ð 	
ð 	
ð 	
ñ 	
ô 	
ð 	
ð	
ð 	
ð 	
ð 	
ð 	
ñ 	
ô 	
ð 	
ð	
ð 	
ð 	
ð 	
ð 	
ñ 	
ô 	
ð 	
ð	
ð 	
ð 	
ð 	
ð 	
ñ 	
ô 	
ð 	
ð 	
ð 	
r0   