ó
    üÞ jÖY  ã                  ó�  • S SK Jr  S SKJrJr  S SKJr  S SKJr  SSKJ	r	J
r
  SSKJr  SSKJrJrJrJrJrJrJrJr  SS	KJrJrJrJr  SS
KJr  SSKJrJr  SSK J!r!J"r"J#r#J$r$  SSK%J&r&J'r'  SSK(J)r)  SSK*J+r+J,r,  SSK-J.r.  SSK/J0r0  SS/r1 " S S\5      r2 " S S\5      r3 " S S5      r4 " S S5      r5 " S S5      r6 " S S5      r7g)é    )Úannotations)ÚListÚUnion)Údatetime)ÚLiteralé   )Útrace_query_paramsÚtrace_list_runs_params)Úhttpx)Ú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                  óì   • \ rS rSr\S
S j5       r\SS j5       r\\\\\SSS\S.	                       SS jjr	\\\\\\\\\SSS\S.                           SS jjr
S	rg)r&   é   c                ó   • [        U 5      $ ©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.
)ÚTracesResourceWithRawResponse©Úselfs    Úd/var/www/html/gaurav/venv/lib/python3.13/site-packages/langsmith/_openapi_client/resources/traces.pyÚwith_raw_responseÚ TracesResource.with_raw_response   s   € ô -¨TÓ2Ð2ó    c                ó   • [        U 5      $ ©zU
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
)Ú#TracesResourceWithStreamingResponser-   s    r/   Úwith_streaming_responseÚ&TracesResource.with_streaming_response'   s   € ô
 3°4Ó8Ð8r2   N©	ÚfilterÚmax_start_timeÚmin_start_timeÚselectsÚacceptÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc       
        óî   • U(       d  [        SU< 35      e0 [        SU05      EU=(       d    0 EnU R                  [        SUS9[	        UU	U
U[        UUUUUS.[        R                  5      S9[        S9$ )át  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©Útrace_id©Ú
project_idr9   r:   r;   r<   ©r>   r?   r@   rA   Úquery©ÚoptionsÚcast_to)	Ú
ValueErrorr   Ú_getr   r#   r   r
   ÚTraceListRunsParamsr%   ©r.   rH   rJ   r9   r:   r;   r<   r=   r>   r?   r@   rA   s               r/   Ú	list_runsÚTracesResource.list_runs.   s�   € öH ÜÐVÐW_ÑVbÐcÓdÐdØXœ?¨H°fÐ+=Ó>ÐXÀ=×CVÐTVÐXˆØ�y‰yÜÐ:ÀXÑNÜ(Ø+Ø'Ø%ØÜ%à&0Ø"(Ø*8Ø*8Ø#*ñô +×>Ñ>ó	ñô  *ð% ð 
ð 	
r2   ©Úcursorr:   r;   Ú	page_sizerJ   r<   Útrace_filterÚ	trace_idsÚtree_filterr>   r?   r@   rA   c               óœ   • U R                  S[        [           [        UUUUUUUUU	S.	[        R
                  5      [        X«XÍS9[        SS9$ ©u)
  
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)	rW   r:   r;   rX   rJ   r<   rY   rZ   r[   )r>   r?   r@   rA   Úpost)ÚpageÚbodyrN   ÚmodelÚmethod)Ú_get_api_listr   r!   r   r	   ÚTraceQueryParamsr#   ©r.   rW   r:   r;   rX   rJ   r<   rY   rZ   r[   r>   r?   r@   rA   s                 r/   rL   ÚTracesResource.queryª   ss   € ðV ×!Ñ!Ø"Ü.¬uÑ5Ü à$Ø&4Ø&4Ø!*Ø",Ø&Ø$0Ø!*Ø#.ñ
ô #×3Ñ3óô )Ø+ÐQ[ñô Øð+ "ð 
ð 	
r2   © )Úreturnr,   )rh   r5   ©rH   ÚstrrJ   rj   r9   ú
str | Omitr:   úUnion[str, datetime] | Omitr;   rl   r<   aÙ  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=   rk   r>   úHeaders | Noner?   úQuery | Noner@   úBody | NonerA   ú'float | httpx.Timeout | None | NotGivenrh   r%   )rW   rk   r:   rl   r;   rl   rX   ú
int | OmitrJ   rk   r<   úList[RunSelectField] | OmitrY   rk   rZ   úSequenceNotStr[str] | Omitr[   rk   r>   rm   r?   rn   r@   ro   rA   rp   rh   z$SyncItemsCursorPostPagination[Trace]©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r0   r6   r   r   rT   rL   Ú__static_attributes__rg   r2   r/   r&   r&      s±  † Øó3ó ð3ð ó9ó ð9ð "Ø6:Ø6:ðd Ø!ð )-Ø$(Ø"&Ø;DñAz
àðz
ð ð	z
ð
 ðz
ð 4ðz
ð 4ðz
ð1ðz
ðt ðuz
ðz &ð{z
ð| "ð}z
ð~  ðz
ð@ 9ðAz
ðB 
õCz
ð~ "Ø6:Ø6:Ø $Ø!%Ø/3Ø#'Ø04Ø"&ð )-Ø$(Ø"&Ø;Dñ#a
ð ða
ð 4ð	a
ð
 4ða
ð ða
ð ða
ð -ða
ð !ða
ð .ða
ð  ða
ð &ða
ð "ða
ð   ð!a
ð" 9ð#a
ð$ 
.÷%a
ð a
r2   c                  óì   • \ rS rSr\S
S j5       r\SS j5       r\\\\\SSS\S.	                       SS jjr	\\\\\\\\\SSS\S.                           SS jjr
S	rg)r'   i  c                ó   • [        U 5      $ r+   )Ú"AsyncTracesResourceWithRawResponser-   s    r/   r0   Ú%AsyncTracesResource.with_raw_response  s   € ô 2°$Ó7Ð7r2   c                ó   • [        U 5      $ r4   )Ú(AsyncTracesResourceWithStreamingResponser-   s    r/   r6   Ú+AsyncTracesResource.with_streaming_response  s   € ô
 8¸Ó=Ð=r2   Nr8   c       
      ƒ  ó  #   • U(       d  [        SU< 35      e0 [        SU05      EU=(       d    0 EnU R                  [        SUS9[	        UU	U
U[        UUUUUS.[        R                  5      I Sh  v•N S9[        S9I Sh  v•N $  N N7f)	rC   rD   rE   rF   rG   rI   NrK   rM   )	rP   r   rQ   r   r#   r   r
   rR   r%   rS   s               r/   rT   ÚAsyncTracesResource.list_runs  s´   é € öH ÜÐVÐW_ÑVbÐcÓdÐdØXœ?¨H°fÐ+=Ó>ÐXÀ=×CVÐTVÐXˆØ—Y‘YÜÐ:ÀXÑNÜ(Ø+Ø'Ø%ØÜ1à&0Ø"(Ø*8Ø*8Ø#*ñô +×>Ñ>ó	÷ 	ñô  *ð% ð 
÷ 
ð 	
ñ	ñ
ùs$   ‚A1BÁ3B	Á4BÂBÂBÂBrV   c               óœ   • U R                  S[        [           [        UUUUUUUUU	S.	[        R
                  5      [        X«XÍS9[        SS9$ r]   )rc   r    r!   r   r	   rd   r#   re   s                 r/   rL   ÚAsyncTracesResource.queryš  ss   € ðV ×!Ñ!Ø"Ü/´Ñ6Ü à$Ø&4Ø&4Ø!*Ø",Ø&Ø$0Ø!*Ø#.ñ
ô #×3Ñ3óô )Ø+ÐQ[ñô Øð+ "ð 
ð 	
r2   rg   )rh   r|   )rh   r   ri   )rW   rk   r:   rl   r;   rl   rX   rq   rJ   rk   r<   rr   rY   rk   rZ   rs   r[   rk   r>   rm   r?   rn   r@   ro   rA   rp   rh   z<AsyncPaginator[Trace, AsyncItemsCursorPostPagination[Trace]]rt   rg   r2   r/   r'   r'     s²  † Øó8ó ð8ð ó>ó ð>ð "Ø6:Ø6:ðd Ø!ð )-Ø$(Ø"&Ø;DñAz
àðz
ð ð	z
ð
 ðz
ð 4ðz
ð 4ðz
ð1ðz
ðt ðuz
ðz &ð{z
ð| "ð}z
ð~  ðz
ð@ 9ðAz
ðB 
õCz
ð~ "Ø6:Ø6:Ø $Ø!%Ø/3Ø#'Ø04Ø"&ð )-Ø$(Ø"&Ø;Dñ#a
ð ða
ð 4ð	a
ð
 4ða
ð ða
ð ða
ð -ða
ð !ða
ð .ða
ð  ða
ð &ða
ð "ða
ð   ð!a
ð" 9ð#a
ð$ 
F÷%a
ð a
r2   c                  ó   • \ rS rSrSS jrSrg)r,   iþ  c                óx   • Xl         [        UR                  5      U l        [        UR                  5      U l        g ©N)Ú_tracesr   rT   rL   ©r.   Útracess     r/   Ú__init__Ú&TracesResourceWithRawResponse.__init__ÿ  s1   € ØŒä0Ø×Ñó
ˆŒô -Ø�L‰Ló
ˆ�
r2   ©rˆ   rT   rL   N©rŠ   r&   rh   ÚNone©ru   rv   rw   rx   r‹   ry   rg   r2   r/   r,   r,   þ  ó   † ÷
r2   r,   c                  ó   • \ rS rSrSS jrSrg)r|   i
  c                óx   • Xl         [        UR                  5      U l        [        UR                  5      U l        g r‡   )rˆ   r   rT   rL   r‰   s     r/   r‹   Ú+AsyncTracesResourceWithRawResponse.__init__  s1   € ØŒä6Ø×Ñó
ˆŒô 3Ø�L‰Ló
ˆ�
r2   r�   N©rŠ   r'   rh   r�   r�   rg   r2   r/   r|   r|   
  r‘   r2   r|   c                  ó   • \ rS rSrSS jrSrg)r5   i  c                óx   • Xl         [        UR                  5      U l        [        UR                  5      U l        g r‡   )rˆ   r   rT   rL   r‰   s     r/   r‹   Ú,TracesResourceWithStreamingResponse.__init__  s1   € ØŒä5Ø×Ñó
ˆŒô 2Ø�L‰Ló
ˆ�
r2   r�   NrŽ   r�   rg   r2   r/   r5   r5     r‘   r2   r5   c                  ó   • \ rS rSrSS jrSrg)r   i"  c                óx   • Xl         [        UR                  5      U l        [        UR                  5      U l        g r‡   )rˆ   r   rT   rL   r‰   s     r/   r‹   Ú1AsyncTracesResourceWithStreamingResponse.__init__#  s1   € ØŒä;Ø×Ñó
ˆŒô 8Ø�L‰Ló
ˆ�
r2   r�   Nr•   r�   rg   r2   r/   r   r   "  r‘   r2   r   N)8Ú
__future__r   Útypingr   r   r   Útyping_extensionsr   Útypesr	   r
   Ú_httpxr   Ú_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,   r|   r5   r   rg   r2   r/   Ú<module>r¬      sœ   ðõ #ç Ý Ý %ç >Ý ß Z× ZÓ Zß [Ó [Ý %ß 9÷ó ÷ WÝ ß ?Ý 3Ý BàÐ2Ð
3€ôm
�_ô m
ô`m
Ð*ô m
÷`	
ñ 	
÷	
ñ 	
÷	
ñ 	
÷	
ò 	
r2   