
    jь                       d dl Zd dlZddl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	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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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l.m/Z/ ddl0m1Z1m2Z2  ejf                  ejh                  d      Z5 G d d      Z6 G d d      Z7y)     N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)Comment)	ErrorInfo)ErrorInfoWrite)FeedbackScoreBatchItem)FeedbackScoreBatchItemThread)FeedbackScoreNamesPublic)FeedbackScoreSource)JsonListString)JsonListStringWrite)ProjectStatsPublic)TraceFilterPublic)TracePagePublic)TracePublic)TraceThread)TraceThreadFilter)TraceThreadPage)TraceThreadUpdate)TraceUpdate)
TraceWrite)
ValueEntry   )AsyncRawTracesClientRawTracesClient.c            !       l   e Zd ZdefdZedefd       Zeeeeeddde	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdZeeeeeddde	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdZeeeeeeeddd	e	de	dedede
j                  e	   de
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e
j&                  e	ef      de
j                  e   ddfdZddde
j,                  e   de
j                  e   ddfdZeddde
j,                  e	   dede
j                  e   de
j                  e   ddf
d Zeddde
j,                  e	   dede
j                  e   de
j                  e   ddf
d!Zeeeedd"d#e
j                  e	   d$e
j                  e	   d%e
j                  e	   d&e
j                  e
j,                  e	      de
j                  e   ddfd'Zdddddddddddddd(d)e
j                  e   d*e
j                  e   d#e
j                  e	   d$e
j                  e	   d+e
j                  e	   d,e
j                  e   d-e
j                  e   d.e
j                  e	   d/e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de fd3Z!eeeeeeeeeeeedd4d5ej                  d	e
j                  e	   d#e
j                  e	   de
j                  e	   d6e
j                  ej                     d7e
j                  e"   d8e
j                  e"   d9e
j                  e"   d:e
j                  e
j,                  e	      d;e
j                  e#   de
j                  ej                     d<e
j                  e   d%e
j                  e	   de
j                  e   ddfd=Z$ddd>d	e	d-e
j                  e   de
j                  e   de%fd?Z&ddd	e	de
j                  e   ddfd@Z'eeeeeeeeeeeeeddAd	e	d#e
j                  e	   d$e
j                  e	   de
j                  e	   d6e
j                  ej                     d7e
j                  e(   d8e
j                  e(   d9e
j                  e(   d:e
j                  e
j,                  e	      dBe
j                  e
j,                  e	      dCe
j                  e
j,                  e	      d;e
j                  e)   d%e
j                  e	   d<e
j                  e   de
j                  e   ddf dDZ*ddde
j,                  e	   de
j                  e   ddfdEZ+eddFd#e	d%e	dGe
j,                  e	   dHe
j                  e	   de
j                  e   ddfdIZ,ddde
j,                  e	   de
j                  e   ddfdJZ-eddFd	e	de	dHe
j                  e	   de
j                  e   ddf
dKZ.eeddLd&e
j,                  e	   d#e
j                  e	   d$e
j                  e	   de
j                  e   ddf
dMZ/ddde
j,                  e	   de
j                  e   ddfdNZ0dddOd$e
j                  e	   de
j                  e   de1fdPZ2dddOd$e
j                  e	   de
j                  e   de1fdQZ3ddddddddRd$e
j                  e	   d#e
j                  e	   d+e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de4fdSZ5ddd%e	dTe	de
j                  e   de6fdUZ7ddddddddRd$e
j                  e	   d#e
j                  e	   d+e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de4fdVZ8dddWe	dTe	de
j                  e   de6fdXZ9eeeddYd%e	d#e
j                  e	   d$e
j                  e	   d,e
j                  e   de
j                  e   de:fdZZ;ddddddddddddd[d)e
j                  e   d*e
j                  e   d#e
j                  e	   d$e
j                  e	   d,e
j                  e   d-e
j                  e   d+e
j                  e	   d.e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de<fd\Z=eeeddYd%e	d#e
j                  e	   d$e
j                  e	   d,e
j                  e   de
j                  e   ddfd]Z>ddd^e
j,                  e?   de
j                  e   ddfd_Z@ddd^e
j,                  eA   de
j                  e   ddfd`ZBeeeeeeeeedda
d#e
j                  e	   d$e
j                  e	   d+e
j                  e
j,                  eC      dbe
j                  e	   dce
j                  e   d,e
j                  e   d-e
j                  e   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de
j                  eE   fddZFeeeeeeeeedde
d#e
j                  e	   d$e
j                  e	   d+e
j                  e
j,                  eG      dfe
j                  e	   dce
j                  e   d,e
j                  e   d-e
j                  e   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de
j                  eE   fdgZHeeeddhdie	d:e
j                  e
j,                  e	      dBe
j                  e
j,                  e	      dCe
j                  e
j,                  e	      de
j                  e   ddfdjZIeeeeedddTe	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdkZJeeeeedddTe	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdlZKy)mTracesClientclient_wrapperc                &    t        |      | _        y N)r    )r   _raw_clientselfr    s     t/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/traces/client.py__init__zTracesClient.__init__#   s    *.I    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawTracesClient
        r#   r%   s    r&   with_raw_responsezTracesClient.with_raw_response&        r(   Nid
created_atlast_updated_at
created_bylast_updated_byrequest_optionsid_textr0   r1   r2   r3   r4   r5   c          
      `    | j                   j                  ||||||||      }	|	j                  S )a  
        Add thread comment

        Parameters
        ----------
        id_ : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.add_thread_comment(id_='id', text='text', )
        r7   r0   r1   r2   r3   r4   r5   r#   add_thread_commentdata
r%   r6   r7   r0   r1   r2   r3   r4   r5   	_responses
             r&   r;   zTracesClient.add_thread_comment1   sD    X $$77!+!++ 8 	
	 ~~r(   c          
      `    | j                   j                  ||||||||      }	|	j                  S )a  
        Add trace comment

        Parameters
        ----------
        id_ : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.add_trace_comment(id_='id', text='text', )
        r9   r#   add_trace_commentr<   r=   s
             r&   rA   zTracesClient.add_trace_commenti   sD    X $$66!+!++ 7 	
	 ~~r(   category_namereasonr1   r2   r3   r4   value_by_authorr5   namevaluesourcerC   rD   rE   c                h    | j                   j                  |||||||||	|
||      }|j                  S )a  
        Add trace feedback score

        Parameters
        ----------
        id : str

        name : str

        value : float

        source : FeedbackScoreSource

        category_name : typing.Optional[str]

        reason : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        value_by_author : typing.Optional[typing.Dict[str, ValueEntry]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.add_trace_feedback_score(id='id', name='name', value=1.1, source="ui", )
        rF   rG   rH   rC   rD   r1   r2   r3   r4   rE   r5   r#   add_trace_feedback_scorer<   r%   r0   rF   rG   rH   rC   rD   r1   r2   r3   r4   rE   r5   r>   s                 r&   rL   z%TracesClient.add_trace_feedback_score   sP    p $$=='!+!+++ > 
	 ~~r(   r5   tracesc                T    | j                   j                  ||      }|j                  S )ai  
        Create traces

        Parameters
        ----------
        traces : typing.Sequence[TraceWrite]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import TraceWrite
        import datetime
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.create_traces(traces=[TraceWrite(start_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )], )
        rO   r5   r#   create_tracesr<   r%   rO   r5   r>   s       r&   rS   zTracesClient.create_traces   s*    2 $$22&Ra2b	~~r(   
merge_tagsr5   idsupdaterV   c                X    | j                   j                  ||||      }|j                  S )a  
        Update multiple traces

        Parameters
        ----------
        ids : typing.Sequence[str]
            List of trace IDs to update (max 1000)

        update : TraceUpdate

        merge_tags : typing.Optional[bool]
            If true, merge tags with existing tags instead of replacing them. Default: false

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import TraceUpdate
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.batch_update_traces(ids=['ids'], update=TraceUpdate(), )
        rW   rX   rV   r5   r#   batch_update_tracesr<   r%   rW   rX   rV   r5   r>   s         r&   r\   z TracesClient.batch_update_traces  s5    F $$88Fz? 9 
	 ~~r(   c                X    | j                   j                  ||||      }|j                  S )a  
        Update multiple threads

        Parameters
        ----------
        ids : typing.Sequence[str]
            List of thread model IDs to update (max 1000)

        update : TraceThreadUpdate

        merge_tags : typing.Optional[bool]
            If true, merge tags with existing tags instead of replacing them. Default: false

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import TraceThreadUpdate
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.batch_update_threads(ids=['ids'], update=TraceThreadUpdate(), )
        rZ   r#   batch_update_threadsr<   r]   s         r&   r`   z!TracesClient.batch_update_threads-  s5    F $$99Fz? : 
	 ~~r(   project_name
project_id	thread_id
thread_idsr5   rb   rc   rd   re   c                Z    | j                   j                  |||||      }|j                  S )a  
        Close one or multiple trace threads. Supports both single thread_id and multiple thread_ids for batch operations.

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        thread_id : typing.Optional[str]

        thread_ids : typing.Optional[typing.Sequence[str]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.close_trace_thread()
        ra   r#   close_trace_threadr<   r%   rb   rc   rd   re   r5   r>   s          r&   rh   zTracesClient.close_trace_threadU  s;    F $$77%!!+ 8 
	 ~~r(   pagesizerb   rc   filterstruncatestrip_attachmentssortingexcludesearch	from_timeto_timer5   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   c                j    | j                   j                  |||||||||	|
|||      }|j                  S )a  
        Get traces by project_name or project_id

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[str]

        truncate : typing.Optional[bool]

        strip_attachments : typing.Optional[bool]

        sorting : typing.Optional[str]

        exclude : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TracePagePublic
            Trace resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_traces_by_project()
        rj   r#   get_traces_by_projectr<   r%   rk   rl   rb   rc   rm   rn   ro   rp   rq   rr   rs   rt   r5   r>   s                  r&   rw   z"TracesClient.get_traces_by_project  sS    x $$::%!/+ ; 
	 ~~r(   r0   rb   rF   end_timeinputoutputmetadatatags
error_infor2   ttftrd   r5   
start_timerz   r{   r|   r}   r~   r   r   c                l    | j                   j                  |||||||||	|
||||      }|j                  S )a  
        Get trace

        Parameters
        ----------
        start_time : dt.datetime

        id : typing.Optional[str]

        project_name : typing.Optional[str]
            If null, the default project is used

        name : typing.Optional[str]

        end_time : typing.Optional[dt.datetime]

        input : typing.Optional[JsonListStringWrite]

        output : typing.Optional[JsonListStringWrite]

        metadata : typing.Optional[JsonListStringWrite]

        tags : typing.Optional[typing.Sequence[str]]

        error_info : typing.Optional[ErrorInfoWrite]

        last_updated_at : typing.Optional[dt.datetime]

        ttft : typing.Optional[float]
            Time to first token in milliseconds

        thread_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        import datetime
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.create_trace(start_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )
        r   r0   rb   rF   rz   r{   r|   r}   r~   r   r2   r   rd   r5   r#   create_tracer<   r%   r   r0   rb   rF   rz   r{   r|   r}   r~   r   r2   r   rd   r5   r>   s                   r&   r   zTracesClient.create_trace  sV    B $$11!%!++ 2 
	  ~~r(   ro   r5   c                V    | j                   j                  |||      }|j                  S )a  
        Get trace by id

        Parameters
        ----------
        id : str

        strip_attachments : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TracePublic
            Trace resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_by_id(id='id', )
        r   r#   get_trace_by_idr<   r%   r0   ro   r5   r>   s        r&   r   zTracesClient.get_trace_by_id!  s3    < $$44"3_ 5 
	 ~~r(   c                T    | j                   j                  ||      }|j                  S )a  
        Delete trace by id

        Parameters
        ----------
        id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_trace_by_id(id='id', )
        rN   r#   delete_trace_by_idr<   r%   r0   r5   r>   s       r&   r   zTracesClient.delete_trace_by_idD  s)    * $$77O7\	~~r(   rb   rc   rF   rz   r{   r|   r}   r~   tags_to_addtags_to_remover   rd   r   r5   r   r   c                n    | j                   j                  |||||||||	|
|||||      }|j                  S )a  
        Update trace by id

        Parameters
        ----------
        id : str

        project_name : typing.Optional[str]
            If null and project_id not specified, Default Project is assumed

        project_id : typing.Optional[str]
            If null and project_name not specified, Default Project is assumed

        name : typing.Optional[str]

        end_time : typing.Optional[dt.datetime]

        input : typing.Optional[JsonListString]

        output : typing.Optional[JsonListString]

        metadata : typing.Optional[JsonListString]

        tags : typing.Optional[typing.Sequence[str]]
            Tags

        tags_to_add : typing.Optional[typing.Sequence[str]]
            Tags to add

        tags_to_remove : typing.Optional[typing.Sequence[str]]
            Tags to remove

        error_info : typing.Optional[ErrorInfo]

        thread_id : typing.Optional[str]

        ttft : typing.Optional[float]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.update_trace(id='id', )
        r   r#   update_tracer<   r%   r0   rb   rc   rF   rz   r{   r|   r}   r~   r   r   r   rd   r   r5   r>   s                    r&   r   zTracesClient.update_trace\  sY    L $$11%!#)!+ 2 
	" ~~r(   c                T    | j                   j                  ||      }|j                  S )a  
        Delete thread comments

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_thread_comments(ids=['ids'], )
        rW   r5   r#   delete_thread_commentsr<   r%   rW   r5   r>   s       r&   r   z#TracesClient.delete_thread_comments  s*    . $$;;Ud;e	~~r(   authorr5   namesr   c                Z    | j                   j                  |||||      }|j                  S )a  
        Delete thread feedback scores

        Parameters
        ----------
        project_name : str

        thread_id : str

        names : typing.Sequence[str]

        author : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_thread_feedback_scores(project_name='project_name', thread_id='thread_id', names=['names'], )
        rb   rd   r   r   r5   r#   delete_thread_feedback_scoresr<   r%   rb   rd   r   r   r5   r>   s          r&   r   z*TracesClient.delete_thread_feedback_scores  s:    F $$BB%%PVhw C 
	 ~~r(   c                T    | j                   j                  ||      }|j                  S )a  
        Delete trace comments

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_trace_comments(ids=['ids'], )
        r   r#   delete_trace_commentsr<   r   s       r&   r   z"TracesClient.delete_trace_comments  s*    . $$::sTc:d	~~r(   c                X    | j                   j                  ||||      }|j                  S )a  
        Delete trace feedback score

        Parameters
        ----------
        id : str

        name : str

        author : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_trace_feedback_score(id='id', name='name', )
        rF   r   r5   r#   delete_trace_feedback_scorer<   r%   r0   rF   r   r5   r>   s         r&   r   z(TracesClient.delete_trace_feedback_score  s6    @ $$@@T&/ A 
	 ~~r(   rb   rc   r5   c                X    | j                   j                  ||||      }|j                  S )a  
        Delete trace threads

        Parameters
        ----------
        thread_ids : typing.Sequence[str]

        project_name : typing.Optional[str]
            If null, project_id must be provided

        project_id : typing.Optional[str]
            If null, project_name must be provided

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_trace_threads(thread_ids=['thread_ids'], )
        re   rb   rc   r5   r#   delete_trace_threadsr<   r%   re   rb   rc   r5   r>   s         r&   r   z!TracesClient.delete_trace_threads6  s6    D $$99!et : 
	 ~~r(   c                T    | j                   j                  ||      }|j                  S )a  
        Delete traces

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.delete_traces(ids=['ids'], )
        r   r#   delete_tracesr<   r   s       r&   r   zTracesClient.delete_traces]  s)    . $$22sO2\	~~r(   rc   r5   c                T    | j                   j                  ||      }|j                  S )a  
        Find Feedback Score names

        Parameters
        ----------
        project_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FeedbackScoreNamesPublic
            Feedback Scores resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.find_feedback_score_names2()
        r   r#   find_feedback_score_names2r<   r%   rc   r5   r>   s       r&   r   z'TracesClient.find_feedback_score_names2w  s*    0 $$??:gv?w	~~r(   c                T    | j                   j                  ||      }|j                  S )aD  
        Find Trace Threads Feedback Score names

        Parameters
        ----------
        project_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FeedbackScoreNamesPublic
            Find Trace Threads Feedback Score names

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.find_trace_threads_feedback_score_names()
        r   r#   'find_trace_threads_feedback_score_namesr<   r   s       r&   r   z4TracesClient.find_trace_threads_feedback_score_names  s1    0 $$LL!? M 
	 ~~r(   rc   rb   rm   rr   rs   rt   r5   c          	      ^    | j                   j                  |||||||      }|j                  S )a  
        Get trace stats

        Parameters
        ----------
        project_id : typing.Optional[str]

        project_name : typing.Optional[str]

        filters : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectStatsPublic
            Trace stats resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_stats()
        r   r#   get_trace_statsr<   	r%   rc   rb   rm   rr   rs   rt   r5   r>   s	            r&   r   zTracesClient.get_trace_stats  sA    T $$44!%+ 5 
	 ~~r(   
comment_idc                V    | j                   j                  |||      }|j                  S )a(  
        Get thread comment

        Parameters
        ----------
        thread_id : str

        comment_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Comment
            Comment resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_thread_comment(thread_id='threadId', comment_id='commentId', )
        rN   r#   get_thread_commentr<   r%   rd   r   r5   r>   s        r&   r   zTracesClient.get_thread_comment  s,    4 $$77	:_n7o	~~r(   c          	      ^    | j                   j                  |||||||      }|j                  S )a  
        Get trace thread stats

        Parameters
        ----------
        project_id : typing.Optional[str]

        project_name : typing.Optional[str]

        filters : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectStatsPublic
            Trace thread stats resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_thread_stats()
        r   r#   get_trace_thread_statsr<   r   s	            r&   r   z#TracesClient.get_trace_thread_stats  sA    T $$;;!%+ < 
	 ~~r(   trace_idc                V    | j                   j                  |||      }|j                  S )a#  
        Get trace comment

        Parameters
        ----------
        trace_id : str

        comment_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Comment
            Comment resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_comment(trace_id='traceId', comment_id='commentId', )
        rN   r#   get_trace_commentr<   r%   r   r   r5   r>   s        r&   r   zTracesClient.get_trace_comment6  s,    4 $$66x]l6m	~~r(   rb   rc   rn   r5   c                Z    | j                   j                  |||||      }|j                  S )a~  
        Get trace thread

        Parameters
        ----------
        thread_id : str

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TraceThread
            Trace thread resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_thread(thread_id='thread_id', )
        rd   rb   rc   rn   r5   r#   get_trace_threadr<   r%   rd   rb   rc   rn   r5   r>   s          r&   r   zTracesClient.get_trace_threadS  s;    H $$55%!+ 6 
	 ~~r(   rk   rl   rb   rc   rn   ro   rm   rp   rr   rs   rt   r5   c                h    | j                   j                  |||||||||	|
||      }|j                  S )a  
        Get trace threads

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        strip_attachments : typing.Optional[bool]

        filters : typing.Optional[str]

        sorting : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TraceThreadPage
            Trace threads resource

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.get_trace_threads()
        r   r#   get_trace_threadsr<   r%   rk   rl   rb   rc   rn   ro   rm   rp   rr   rs   rt   r5   r>   s                 r&   r   zTracesClient.get_trace_threads  sP    r $$66%!/+ 7 
	 ~~r(   c                Z    | j                   j                  |||||      }|j                  S )aW  
        Open trace thread

        Parameters
        ----------
        thread_id : str

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.open_trace_thread(thread_id='thread_id', )
        r   r#   open_trace_threadr<   r   s          r&   r   zTracesClient.open_trace_thread  s;    F $$66%!+ 7 
	 ~~r(   scoresc                T    | j                   j                  ||      }|j                  S )a  
        Batch feedback scoring for threads

        Parameters
        ----------
        scores : typing.Sequence[FeedbackScoreBatchItemThread]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import FeedbackScoreBatchItemThread
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.score_batch_of_threads(scores=[FeedbackScoreBatchItemThread(name='name', value=1.1, source="ui", thread_id='thread_id', )], )
        r   r5   r#   score_batch_of_threadsr<   r%   r   r5   r>   s       r&   r   z#TracesClient.score_batch_of_threads  s*    6 $$;;6[j;k	~~r(   c                T    | j                   j                  ||      }|j                  S )at  
        Batch feedback scoring for traces

        Parameters
        ----------
        scores : typing.Sequence[FeedbackScoreBatchItem]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import FeedbackScoreBatchItem
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.score_batch_of_traces(scores=[FeedbackScoreBatchItem(name='name', value=1.1, source="ui", id='id', )], )
        r   r#   score_batch_of_tracesr<   r   s       r&   r   z"TracesClient.score_batch_of_traces  s*    6 $$::&Zi:j	~~r(   
rb   rc   rm   last_retrieved_thread_model_idlimitrn   ro   rs   rt   r5   r   r   c       
      #      K   | j                   j                  |||||||||	|

      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)a  
        Search trace threads

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[typing.Sequence[TraceThreadFilter]]

        last_retrieved_thread_model_id : typing.Optional[str]

        limit : typing.Optional[int]
            Max number of trace thread to be streamed

        truncate : typing.Optional[bool]
            Truncate input, output and metadata to slim payloads

        strip_attachments : typing.Optional[bool]
            If true, returns attachment references like [file.png]; if false, downloads and reinjects stripped attachments

        from_time : typing.Optional[dt.datetime]
            Filter trace threads created from this time (ISO-8601 format).

        to_time : typing.Optional[dt.datetime]
            Filter trace threads created up to this time (ISO-8601 format). If not provided, defaults to current time. Must be after 'from_time'.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[bytes]
            Trace threads stream or error during process

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.search_trace_threads()
        r   Nr#   search_trace_threadsr<   )r%   rb   rc   rm   r   r   rn   ro   rs   rt   r5   rs               r&   r   z!TracesClient.search_trace_threads1  sl     p 22%!+I/+ 3 
 vv
 
 
 
+   &AAAA	AAAA
rb   rc   rm   last_retrieved_idr   rn   ro   rs   rt   r5   r   c       
      #      K   | j                   j                  |||||||||	|

      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)a  
        Search traces

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[typing.Sequence[TraceFilterPublic]]

        last_retrieved_id : typing.Optional[str]

        limit : typing.Optional[int]
            Max number of traces to be streamed

        truncate : typing.Optional[bool]
            Truncate input, output and metadata to slim payloads

        strip_attachments : typing.Optional[bool]
            If true, returns attachment references like [file.png]; if false, downloads and reinjects stripped attachments

        from_time : typing.Optional[dt.datetime]
            Filter traces created from this time (ISO-8601 format).

        to_time : typing.Optional[dt.datetime]
            Filter traces created up to this time (ISO-8601 format). If not provided, defaults to current time. Must be after 'from_time'.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[bytes]
            Traces stream or error during process

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.search_traces()
        r   Nr#   search_tracesr<   )r%   rb   rc   rm   r   r   rn   ro   rs   rt   r5   r   s               r&   r   zTracesClient.search_tracesw  sl     p ++%!//+ , 
 vv
 
 
 
r   r~   r   r   r5   thread_model_idc                Z    | j                   j                  |||||      }|j                  S )a  
        Update thread

        Parameters
        ----------
        thread_model_id : str

        tags : typing.Optional[typing.Sequence[str]]

        tags_to_add : typing.Optional[typing.Sequence[str]]

        tags_to_remove : typing.Optional[typing.Sequence[str]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.update_thread(thread_model_id='threadModelId', )
        r   r#   update_threadr<   r%   r   r~   r   r   r5   r>   s          r&   r   zTracesClient.update_thread  s;    F $$22#)+ 3 
	 ~~r(   c          
      `    | j                   j                  ||||||||      }	|	j                  S )a  
        Update thread comment by id

        Parameters
        ----------
        comment_id : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.update_thread_comment(comment_id='commentId', text='text', )
        r9   r#   update_thread_commentr<   
r%   r   r7   r0   r1   r2   r3   r4   r5   r>   s
             r&   r   z"TracesClient.update_thread_comment  sD    X $$::!+!++ ; 	
	 ~~r(   c          
      `    | j                   j                  ||||||||      }	|	j                  S )a  
        Update trace comment by id

        Parameters
        ----------
        comment_id : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.traces.update_trace_comment(comment_id='commentId', text='text', )
        r9   r#   update_trace_commentr<   r   s
             r&   r   z!TracesClient.update_trace_comment!  sD    X $$99!+!++ : 	
	 ~~r(   )L__name__
__module____qualname__r   r'   propertyr   r-   OMITstrtypingOptionaldtdatetimer   r;   rA   floatr   Dictr   rL   Sequencer   rS   r   boolr\   r   r`   rh   intr   rw   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r
   r   r   Iteratorbytesr   r   r   r   r   r    r(   r&   r   r   "   sT   J*; J  ?     $(378<+/04;?66 	6
 OOC 6 OOBKK06  56 OOC(6  -6  86 
6z $(378<+/04;?66 	6
 OOC 6 OOBKK06  56 OOC(6  -6  86 
6~ /3'+378<+/04IM;?FF 	F
 F $F s+F $F OOBKK0F  5F OOC(F  -F  S*_)EFF  8F 
FR jn4GMWeGf	B -1;?& __S!& 	&
 OOD)&  8& 
&Z -1;?& __S!& "	&
 OOD)&  8& 
&V .2+/*.<@;?* ooc** OOC(	*
 ??3'* OOFOOC$89*  8* 
*^ &*%)-1+/(,*.37(,(,'+2604;?K ooc"K ooc"	K
 ooc*K OOC(K %K //$'K "??40K %K %K $K ??2;;/K -K  8K  
!Kb $(-1%)156:7;9=6:6:8<'+*.;?!Q KKQ OOC 	Q
 ooc*Q ooc"Q //"++.Q 23Q  34Q //"56Q oofooc23Q OON3Q  5Q ooe$Q ??3'Q   8!Q" 
#Qn 48;?!! "??40	!
  8! 
!F ae S foon>] im 8 .2+/%)151526486:=A@D15*.'+;?#WW ooc*	W
 OOC(W ooc"W //"++.W ~.W /W //.1W oofooc23W __V__S%9:W (<=W OOI.W ??3'W  ooe$!W"  8#W$ 
%Wt `dooc*=C__^=\	@ (,;?& & 	&
 s#& $&  8& 
&R `dooc*=C__^=\	> (,;?## 	#
 $#  8# 
#R .2+/;?% OOC(% ooc*	%
 OOC(%  8% 
%P `dooc*=C__^=\	6 59mq#__S1KQ??[iKj	!8 59mq#__S1KQ??[iKj	!@ ,0-1(,'+2604;?3 OOC(3 ooc*	3
 %3 $3 ??2;;/3 -3  83 
3l fj*-CI??SaCb	@ ,0-1(,'+2604;?3 OOC(3 ooc*	3
 %3 $3 ??2;;/3 -3  83 
3l ei),BH//R`Ba	B .2+/*.;?+ + ooc*	+
 OOC(+ //$'+  8+ 
+` &*%)-1+/*.37(,(,'+2604;?G ooc"G ooc"	G
 ooc*G OOC(G //$'G "??40G %G %G $G ??2;;/G -G  8G 
GZ .2+/*.;?* * ooc*	*
 OOC(* //$'*  8* 
*` <@	  <=  8	
 
D <@	  67  8	
 
B .2+/GK?C&**.372604;?D ooc*D OOC(	D
 1B!CDD )/(<D s#D //$'D "??40D ??2;;/D -D  8D 
	DR .2+/GK26&**.372604;?D ooc*D OOC(	D
 1B!CDD "??3/D s#D //$'D "??40D ??2;;/D -D  8D 
	DT 7;=A@D;?** oofooc23	*
 __V__S%9:* (<=*  8* 
*b $(378<+/04;?66 	6
 OOC 6 OOBKK06  56 OOC(6  -6  86 
6z $(378<+/04;?66 	6
 OOC 6 OOBKK06  56 OOC(6  -6  86 
6r(   r   c            !       l   e Zd ZdefdZedefd       Zeeeeeddde	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdZeeeeeddde	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdZeeeeeeeddd	e	de	dedede
j                  e	   de
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e
j&                  e	ef      de
j                  e   ddfdZddde
j,                  e   de
j                  e   ddfdZeddde
j,                  e	   dede
j                  e   de
j                  e   ddf
d Zeddde
j,                  e	   dede
j                  e   de
j                  e   ddf
d!Zeeeedd"d#e
j                  e	   d$e
j                  e	   d%e
j                  e	   d&e
j                  e
j,                  e	      de
j                  e   ddfd'Zdddddddddddddd(d)e
j                  e   d*e
j                  e   d#e
j                  e	   d$e
j                  e	   d+e
j                  e	   d,e
j                  e   d-e
j                  e   d.e
j                  e	   d/e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de fd3Z!eeeeeeeeeeeedd4d5ej                  d	e
j                  e	   d#e
j                  e	   de
j                  e	   d6e
j                  ej                     d7e
j                  e"   d8e
j                  e"   d9e
j                  e"   d:e
j                  e
j,                  e	      d;e
j                  e#   de
j                  ej                     d<e
j                  e   d%e
j                  e	   de
j                  e   ddfd=Z$ddd>d	e	d-e
j                  e   de
j                  e   de%fd?Z&ddd	e	de
j                  e   ddfd@Z'eeeeeeeeeeeeeddAd	e	d#e
j                  e	   d$e
j                  e	   de
j                  e	   d6e
j                  ej                     d7e
j                  e(   d8e
j                  e(   d9e
j                  e(   d:e
j                  e
j,                  e	      dBe
j                  e
j,                  e	      dCe
j                  e
j,                  e	      d;e
j                  e)   d%e
j                  e	   d<e
j                  e   de
j                  e   ddf dDZ*ddde
j,                  e	   de
j                  e   ddfdEZ+eddFd#e	d%e	dGe
j,                  e	   dHe
j                  e	   de
j                  e   ddfdIZ,ddde
j,                  e	   de
j                  e   ddfdJZ-eddFd	e	de	dHe
j                  e	   de
j                  e   ddf
dKZ.eeddLd&e
j,                  e	   d#e
j                  e	   d$e
j                  e	   de
j                  e   ddf
dMZ/ddde
j,                  e	   de
j                  e   ddfdNZ0dddOd$e
j                  e	   de
j                  e   de1fdPZ2dddOd$e
j                  e	   de
j                  e   de1fdQZ3ddddddddRd$e
j                  e	   d#e
j                  e	   d+e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de4fdSZ5ddd%e	dTe	de
j                  e   de6fdUZ7ddddddddRd$e
j                  e	   d#e
j                  e	   d+e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de4fdVZ8dddWe	dTe	de
j                  e   de6fdXZ9eeeddYd%e	d#e
j                  e	   d$e
j                  e	   d,e
j                  e   de
j                  e   de:fdZZ;ddddddddddddd[d)e
j                  e   d*e
j                  e   d#e
j                  e	   d$e
j                  e	   d,e
j                  e   d-e
j                  e   d+e
j                  e	   d.e
j                  e	   d0e
j                  e	   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de<fd\Z=eeeddYd%e	d#e
j                  e	   d$e
j                  e	   d,e
j                  e   de
j                  e   ddfd]Z>ddd^e
j,                  e?   de
j                  e   ddfd_Z@ddd^e
j,                  eA   de
j                  e   ddfd`ZBeeeeeeeeedda
d#e
j                  e	   d$e
j                  e	   d+e
j                  e
j,                  eC      dbe
j                  e	   dce
j                  e   d,e
j                  e   d-e
j                  e   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de
j                  eE   fddZFeeeeeeeeedde
d#e
j                  e	   d$e
j                  e	   d+e
j                  e
j,                  eG      dfe
j                  e	   dce
j                  e   d,e
j                  e   d-e
j                  e   d1e
j                  ej                     d2e
j                  ej                     de
j                  e   de
j                  eE   fdgZHeeeddhdie	d:e
j                  e
j,                  e	      dBe
j                  e
j,                  e	      dCe
j                  e
j,                  e	      de
j                  e   ddfdjZIeeeeedddTe	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdkZJeeeeedddTe	de	d	e
j                  e	   d
e
j                  ej                     de
j                  ej                     de
j                  e	   de
j                  e	   de
j                  e   ddfdlZKy)mAsyncTracesClientr    c                &    t        |      | _        y r"   )r   r#   r$   s     r&   r'   zAsyncTracesClient.__init__[  s    /~Nr(   r)   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawTracesClient
        r+   r,   s    r&   r-   z#AsyncTracesClient.with_raw_response^  r.   r(   Nr/   r6   r7   r0   r1   r2   r3   r4   r5   c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)a7  
        Add thread comment

        Parameters
        ----------
        id_ : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.add_thread_comment(id_='id', text='text', )
        asyncio.run(main())
        r9   Nr:   r=   s
             r&   r;   z$AsyncTracesClient.add_thread_commenti  sR     ^ **==!+!++ > 	
 	
	 ~~	
   '<:<c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)a5  
        Add trace comment

        Parameters
        ----------
        id_ : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.add_trace_comment(id_='id', text='text', )
        asyncio.run(main())
        r9   Nr@   r=   s
             r&   rA   z#AsyncTracesClient.add_trace_comment  sR     ^ **<<!+!++ = 	
 	
	 ~~	
r  rB   rF   rG   rH   rC   rD   rE   c                   K   | j                   j                  |||||||||	|
||       d{   }|j                  S 7 w)a  
        Add trace feedback score

        Parameters
        ----------
        id : str

        name : str

        value : float

        source : FeedbackScoreSource

        category_name : typing.Optional[str]

        reason : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        value_by_author : typing.Optional[typing.Dict[str, ValueEntry]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.add_trace_feedback_score(id='id', name='name', value=1.1, source="ui", )
        asyncio.run(main())
        rJ   NrK   rM   s                 r&   rL   z*AsyncTracesClient.add_trace_feedback_score  s_     v **CC'!+!+++ D 
 
	 ~~
   +A >A rN   rO   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Create traces

        Parameters
        ----------
        traces : typing.Sequence[TraceWrite]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import TraceWrite
        import datetime
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.create_traces(traces=[TraceWrite(start_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )], )
        asyncio.run(main())
        rQ   NrR   rT   s       r&   rS   zAsyncTracesClient.create_traces*  s7     8 **88Xg8hh	~~ i   !646rU   rW   rX   rV   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a[  
        Update multiple traces

        Parameters
        ----------
        ids : typing.Sequence[str]
            List of trace IDs to update (max 1000)

        update : TraceUpdate

        merge_tags : typing.Optional[bool]
            If true, merge tags with existing tags instead of replacing them. Default: false

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import TraceUpdate
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.batch_update_traces(ids=['ids'], update=TraceUpdate(), )
        asyncio.run(main())
        rZ   Nr[   r]   s         r&   r\   z%AsyncTracesClient.batch_update_tracesI  sC     L **>>Fz? ? 
 
	 ~~
   #868c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)av  
        Update multiple threads

        Parameters
        ----------
        ids : typing.Sequence[str]
            List of thread model IDs to update (max 1000)

        update : TraceThreadUpdate

        merge_tags : typing.Optional[bool]
            If true, merge tags with existing tags instead of replacing them. Default: false

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import TraceThreadUpdate
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.batch_update_threads(ids=['ids'], update=TraceThreadUpdate(), )
        asyncio.run(main())
        rZ   Nr_   r]   s         r&   r`   z&AsyncTracesClient.batch_update_threadst  sD     L **??Fz? @ 
 
	 ~~
r  ra   rb   rc   rd   re   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a-  
        Close one or multiple trace threads. Supports both single thread_id and multiple thread_ids for batch operations.

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        thread_id : typing.Optional[str]

        thread_ids : typing.Optional[typing.Sequence[str]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.close_trace_thread()
        asyncio.run(main())
        ra   Nrg   ri   s          r&   rh   z$AsyncTracesClient.close_trace_thread  sI     L **==%!!+ > 
 
	 ~~
   $979rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   c                   K   | j                   j                  |||||||||	|
|||       d{   }|j                  S 7 w)aO  
        Get traces by project_name or project_id

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[str]

        truncate : typing.Optional[bool]

        strip_attachments : typing.Optional[bool]

        sorting : typing.Optional[str]

        exclude : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TracePagePublic
            Trace resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_traces_by_project()
        asyncio.run(main())
        rj   Nrv   rx   s                  r&   rw   z'AsyncTracesClient.get_traces_by_project  sb     ~ **@@%!/+ A 
 
	 ~~
s   ,A?Ary   r   rz   r{   r|   r}   r~   r   r   c                   K   | j                   j                  |||||||||	|
||||       d{   }|j                  S 7 w)a(  
        Get trace

        Parameters
        ----------
        start_time : dt.datetime

        id : typing.Optional[str]

        project_name : typing.Optional[str]
            If null, the default project is used

        name : typing.Optional[str]

        end_time : typing.Optional[dt.datetime]

        input : typing.Optional[JsonListStringWrite]

        output : typing.Optional[JsonListStringWrite]

        metadata : typing.Optional[JsonListStringWrite]

        tags : typing.Optional[typing.Sequence[str]]

        error_info : typing.Optional[ErrorInfoWrite]

        last_updated_at : typing.Optional[dt.datetime]

        ttft : typing.Optional[float]
            Time to first token in milliseconds

        thread_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import datetime
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.create_trace(start_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00", ), )
        asyncio.run(main())
        r   Nr   r   s                   r&   r   zAsyncTracesClient.create_trace  sd     H **77!%!++ 8 
 
	  ~~!
s   -AA Ar   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)az  
        Get trace by id

        Parameters
        ----------
        id : str

        strip_attachments : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TracePublic
            Trace resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_by_id(id='id', )
        asyncio.run(main())
        r   Nr   r   s        r&   r   z!AsyncTracesClient.get_trace_by_idt  sB     B **::"3_ ; 
 
	 ~~
   "757c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a+  
        Delete trace by id

        Parameters
        ----------
        id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_trace_by_id(id='id', )
        asyncio.run(main())
        rN   Nr   r   s       r&   r   z$AsyncTracesClient.delete_trace_by_id  s7     0 **==bRa=bb	~~ cr  r   r   r   c                   K   | j                   j                  |||||||||	|
|||||       d{   }|j                  S 7 w)a  
        Update trace by id

        Parameters
        ----------
        id : str

        project_name : typing.Optional[str]
            If null and project_id not specified, Default Project is assumed

        project_id : typing.Optional[str]
            If null and project_name not specified, Default Project is assumed

        name : typing.Optional[str]

        end_time : typing.Optional[dt.datetime]

        input : typing.Optional[JsonListString]

        output : typing.Optional[JsonListString]

        metadata : typing.Optional[JsonListString]

        tags : typing.Optional[typing.Sequence[str]]
            Tags

        tags_to_add : typing.Optional[typing.Sequence[str]]
            Tags to add

        tags_to_remove : typing.Optional[typing.Sequence[str]]
            Tags to remove

        error_info : typing.Optional[ErrorInfo]

        thread_id : typing.Optional[str]

        ttft : typing.Optional[float]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.update_trace(id='id', )
        asyncio.run(main())
        r   Nr   r   s                    r&   r   zAsyncTracesClient.update_trace  sg     R **77%!#)!+ 8 
 
	" ~~#
s   .AAAc                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aI  
        Delete thread comments

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_thread_comments(ids=['ids'], )
        asyncio.run(main())
        r   Nr   r   s       r&   r   z(AsyncTracesClient.delete_thread_comments	  s7     4 **AAc[jAkk	~~ lr  r   r   r   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Delete thread feedback scores

        Parameters
        ----------
        project_name : str

        thread_id : str

        names : typing.Sequence[str]

        author : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_thread_feedback_scores(project_name='project_name', thread_id='thread_id', names=['names'], )
        asyncio.run(main())
        r   Nr   r   s          r&   r   z/AsyncTracesClient.delete_thread_feedback_scores.	  sH     L **HH%%PVhw I 
 
	 ~~
r!  c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aG  
        Delete trace comments

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_trace_comments(ids=['ids'], )
        asyncio.run(main())
        r   Nr   r   s       r&   r   z'AsyncTracesClient.delete_trace_commentsY	  s7     4 **@@SZi@jj	~~ kr  c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        Delete trace feedback score

        Parameters
        ----------
        id : str

        name : str

        author : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_trace_feedback_score(id='id', name='name', )
        asyncio.run(main())
        r   Nr   r   s         r&   r   z-AsyncTracesClient.delete_trace_feedback_scorev	  sD     F **FFT&/ G 
 
	 ~~
r  r   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        Delete trace threads

        Parameters
        ----------
        thread_ids : typing.Sequence[str]

        project_name : typing.Optional[str]
            If null, project_id must be provided

        project_id : typing.Optional[str]
            If null, project_name must be provided

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_trace_threads(thread_ids=['thread_ids'], )
        asyncio.run(main())
        r   Nr   r   s         r&   r   z&AsyncTracesClient.delete_trace_threads	  sE     J **??!et @ 
 
	 ~~
r  c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a7  
        Delete traces

        Parameters
        ----------
        ids : typing.Sequence[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.delete_traces(ids=['ids'], )
        asyncio.run(main())
        r   Nr   r   s       r&   r   zAsyncTracesClient.delete_traces	  s7     4 **88SRa8bb	~~ cr  r   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Find Feedback Score names

        Parameters
        ----------
        project_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FeedbackScoreNamesPublic
            Feedback Scores resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.find_feedback_score_names2()
        asyncio.run(main())
        r   Nr   r   s       r&   r   z,AsyncTracesClient.find_feedback_score_names2	  s?     6 **EE!? F 
 
	 ~~
r  c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Find Trace Threads Feedback Score names

        Parameters
        ----------
        project_id : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FeedbackScoreNamesPublic
            Find Trace Threads Feedback Score names

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.find_trace_threads_feedback_score_names()
        asyncio.run(main())
        r   Nr   r   s       r&   r   z9AsyncTracesClient.find_trace_threads_feedback_score_names
  s?     6 **RR!? S 
 
	 ~~
r  r   c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)aB  
        Get trace stats

        Parameters
        ----------
        project_id : typing.Optional[str]

        project_name : typing.Optional[str]

        filters : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectStatsPublic
            Trace stats resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_stats()
        asyncio.run(main())
        r   Nr   r   s	            r&   r   z!AsyncTracesClient.get_trace_stats%
  sO     Z **::!%+ ; 
 
	 ~~
   &;9;r   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Get thread comment

        Parameters
        ----------
        thread_id : str

        comment_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Comment
            Comment resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_thread_comment(thread_id='threadId', comment_id='commentId', )
        asyncio.run(main())
        rN   Nr   r   s        r&   r   z$AsyncTracesClient.get_thread_comment]
  s9     : **==iet=uu	~~ vr%  c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)aW  
        Get trace thread stats

        Parameters
        ----------
        project_id : typing.Optional[str]

        project_name : typing.Optional[str]

        filters : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectStatsPublic
            Trace thread stats resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_thread_stats()
        asyncio.run(main())
        r   Nr   r   s	            r&   r   z(AsyncTracesClient.get_trace_thread_stats}
  sP     Z **AA!%+ B 
 
	 ~~
r1  r   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Get trace comment

        Parameters
        ----------
        trace_id : str

        comment_id : str

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        Comment
            Comment resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_comment(trace_id='traceId', comment_id='commentId', )
        asyncio.run(main())
        rN   Nr   r   s        r&   r   z#AsyncTracesClient.get_trace_comment
  s9     : **<<Xzcr<ss	~~ tr%  r   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Get trace thread

        Parameters
        ----------
        thread_id : str

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TraceThread
            Trace thread resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_thread(thread_id='thread_id', )
        asyncio.run(main())
        r   Nr   r   s          r&   r   z"AsyncTracesClient.get_trace_thread
  sI     N **;;%!+ < 
 
	 ~~
r!  r   c                   K   | j                   j                  |||||||||	|
||       d{   }|j                  S 7 w)a  
        Get trace threads

        Parameters
        ----------
        page : typing.Optional[int]

        size : typing.Optional[int]

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        strip_attachments : typing.Optional[bool]

        filters : typing.Optional[str]

        sorting : typing.Optional[str]

        search : typing.Optional[str]

        from_time : typing.Optional[dt.datetime]

        to_time : typing.Optional[dt.datetime]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TraceThreadPage
            Trace threads resource

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.get_trace_threads()
        asyncio.run(main())
        r   Nr   r   s                 r&   r   z#AsyncTracesClient.get_trace_threads  s^     x **<<%!/+ = 
 
	 ~~
r  c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Open trace thread

        Parameters
        ----------
        thread_id : str

        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        truncate : typing.Optional[bool]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.open_trace_thread(thread_id='thread_id', )
        asyncio.run(main())
        r   Nr   r   s          r&   r   z#AsyncTracesClient.open_trace_threadQ  sI     L **<<%!+ = 
 
	 ~~
r!  r   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Batch feedback scoring for threads

        Parameters
        ----------
        scores : typing.Sequence[FeedbackScoreBatchItemThread]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import FeedbackScoreBatchItemThread
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.score_batch_of_threads(scores=[FeedbackScoreBatchItemThread(name='name', value=1.1, source="ui", thread_id='thread_id', )], )
        asyncio.run(main())
        r   Nr   r   s       r&   r   z(AsyncTracesClient.score_batch_of_threads  s7     < **AAapAqq	~~ rr  c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Batch feedback scoring for traces

        Parameters
        ----------
        scores : typing.Sequence[FeedbackScoreBatchItem]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import FeedbackScoreBatchItem
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.score_batch_of_traces(scores=[FeedbackScoreBatchItem(name='name', value=1.1, source="ui", id='id', )], )
        asyncio.run(main())
        r   Nr   r   s       r&   r   z'AsyncTracesClient.score_batch_of_traces  s7     < **@@`o@pp	~~ qr  r   r   r   c       
           K   | j                   j                  |||||||||	|

      4 d{   }|j                  2 3 d{   }| 7 7 6 ddd      d{  7   y# 1 d{  7  sw Y   yxY ww)aZ  
        Search trace threads

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[typing.Sequence[TraceThreadFilter]]

        last_retrieved_thread_model_id : typing.Optional[str]

        limit : typing.Optional[int]
            Max number of trace thread to be streamed

        truncate : typing.Optional[bool]
            Truncate input, output and metadata to slim payloads

        strip_attachments : typing.Optional[bool]
            If true, returns attachment references like [file.png]; if false, downloads and reinjects stripped attachments

        from_time : typing.Optional[dt.datetime]
            Filter trace threads created from this time (ISO-8601 format).

        to_time : typing.Optional[dt.datetime]
            Filter trace threads created up to this time (ISO-8601 format). If not provided, defaults to current time. Must be after 'from_time'.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[bytes]
            Trace threads stream or error during process

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.search_trace_threads()
        asyncio.run(main())
        r   Nr   )r%   rb   rc   rm   r   r   rn   ro   rs   rt   r5   r   r<   s                r&   r   z&AsyncTracesClient.search_trace_threads  s     v ##88%!+I/+ 9 
 
 ff d

f
 
 
 
 
g   *A8AA8A#AAAA#A8AA#A8AA8#A5)A,*A51A8r   r   c       
           K   | j                   j                  |||||||||	|

      4 d{   }|j                  2 3 d{   }| 7 7 6 ddd      d{  7   y# 1 d{  7  sw Y   yxY ww)a$  
        Search traces

        Parameters
        ----------
        project_name : typing.Optional[str]

        project_id : typing.Optional[str]

        filters : typing.Optional[typing.Sequence[TraceFilterPublic]]

        last_retrieved_id : typing.Optional[str]

        limit : typing.Optional[int]
            Max number of traces to be streamed

        truncate : typing.Optional[bool]
            Truncate input, output and metadata to slim payloads

        strip_attachments : typing.Optional[bool]
            If true, returns attachment references like [file.png]; if false, downloads and reinjects stripped attachments

        from_time : typing.Optional[dt.datetime]
            Filter traces created from this time (ISO-8601 format).

        to_time : typing.Optional[dt.datetime]
            Filter traces created up to this time (ISO-8601 format). If not provided, defaults to current time. Must be after 'from_time'.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[bytes]
            Traces stream or error during process

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.search_traces()
        asyncio.run(main())
        r   Nr   )r%   rb   rc   rm   r   r   rn   ro   rs   rt   r5   r   r<   s                r&   r   zAsyncTracesClient.search_traces  s     v ##11%!//+ 2 
 
 ff d

f
 
 
 
 
r;  r   r   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Update thread

        Parameters
        ----------
        thread_model_id : str

        tags : typing.Optional[typing.Sequence[str]]

        tags_to_add : typing.Optional[typing.Sequence[str]]

        tags_to_remove : typing.Optional[typing.Sequence[str]]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.update_thread(thread_model_id='threadModelId', )
        asyncio.run(main())
        r   Nr   r   s          r&   r   zAsyncTracesClient.update_threadV  sI     L **88#)+ 9 
 
	 ~~
r!  c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)aX  
        Update thread comment by id

        Parameters
        ----------
        comment_id : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.update_thread_comment(comment_id='commentId', text='text', )
        asyncio.run(main())
        r9   Nr   r   s
             r&   r   z'AsyncTracesClient.update_thread_comment  sS     ^ **@@!+!++ A 	
 	
	 ~~	
r  c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)aV  
        Update trace comment by id

        Parameters
        ----------
        comment_id : str

        text : str

        id : typing.Optional[str]

        created_at : typing.Optional[dt.datetime]

        last_updated_at : typing.Optional[dt.datetime]

        created_by : typing.Optional[str]

        last_updated_by : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.traces.update_trace_comment(comment_id='commentId', text='text', )
        asyncio.run(main())
        r9   Nr   r   s
             r&   r   z&AsyncTracesClient.update_trace_comment  sS     ^ **??!+!++ @ 	
 	
	 ~~	
r  )Lr   r  r  r   r'   r  r   r-   r  r  r  r  r  r	  r   r;   rA   r
  r   r  r   rL   r  r   rS   r   r  r\   r   r`   rh   r  r   rw   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r
   r   r   AsyncIteratorr  r   r   r   r   r   r   r  r(   r&   r  r  Z  s\   O*< O  #7     $(378<+/04;?99 	9
 OOC 9 OOBKK09  59 OOC(9  -9  89 
9@ $(378<+/04;?99 	9
 OOC 9 OOBKK09  59 OOC(9  -9  89 
9D /3'+378<+/04IM;?II 	I
 I $I s+I $I OOBKK0I  5I OOC(I  -I  S*_)EFI  8I 
IX jn4GMWeGf	H -1;?) __S!) 	)
 OOD))  8) 
)` -1;?) __S!) "	)
 OOD))  8) 
)\ .2+/*.<@;?- ooc*- OOC(	-
 ??3'- OOFOOC$89-  8- 
-d &*%)-1+/(,*.37(,(,'+2604;?N ooc"N ooc"	N
 ooc*N OOC(N %N //$'N "??40N %N %N $N ??2;;/N -N  8N  
!Nh $(-1%)156:7;9=6:6:8<'+*.;?!T KKT OOC 	T
 ooc*T ooc"T //"++.T 23T  34T //"56T oofooc23T OON3T  5T ooe$T ??3'T   8!T" 
#Tt 48;?$$ "??40	$
  8$ 
$L gk 3 FOOTbDc os > .2+/%)151526486:=A@D15*.'+;?#ZZ ooc*	Z
 OOC(Z ooc"Z //"++.Z ~.Z /Z //.1Z oofooc23Z __V__S%9:Z (<=Z OOI.Z ??3'Z  ooe$!Z"  8#Z$ 
%Zz `dooc*=C__^=\	F (,;?) ) 	)
 s#) $)  8) 
)X `dooc*=C__^=\	D (,;?&& 	&
 $&  8& 
&X .2+/;?( OOC(( ooc*	(
 OOC((  8( 
(V `dooc*=C__^=\	< 59mq#__S1KQ??[iKj	!B 59mq#__S1KQ??[iKj	!F ,0-1(,'+2604;?6 OOC(6 ooc*	6
 %6 $6 ??2;;/6 -6  86 
6r fj*-CI??SaCb	F ,0-1(,'+2604;?6 OOC(6 ooc*	6
 %6 $6 ??2;;/6 -6  86 
6r ei),BH//R`Ba	H .2+/*.;?. . ooc*	.
 OOC(. //$'.  8. 
.f &*%)-1+/*.37(,(,'+2604;?J ooc"J ooc"	J
 ooc*J OOC(J //$'J "??40J %J %J $J ??2;;/J -J  8J 
J` .2+/*.;?- - ooc*	-
 OOC(- //$'-  8- 
-f <@	  <=  8	
 
J <@	  67  8	
 
H .2+/GK?C&**.372604;?H ooc*H OOC(	H
 1B!CDH )/(<H s#H //$'H "??40H ??2;;/H -H  8H 
		e	$HZ .2+/GK26&**.372604;?H ooc*H OOC(	H
 1B!CDH "??3/H s#H //$'H "??40H ??2;;/H -H  8H 
		e	$H\ 7;=A@D;?-- oofooc23	-
 __V__S%9:- (<=-  8- 
-h $(378<+/04;?99 	9
 OOC 9 OOBKK09  59 OOC(9  -9  89 
9@ $(378<+/04;?99 	9
 OOC 9 OOBKK09  59 OOC(9  -9  89 
9r(   r  )8r	  r  r  core.client_wrapperr   r   core.request_optionsr   types.commentr   types.error_infor   types.error_info_writer	   types.feedback_score_batch_itemr
   &types.feedback_score_batch_item_threadr   !types.feedback_score_names_publicr   types.feedback_score_sourcer   types.json_list_stringr   types.json_list_string_writer   types.project_stats_publicr   types.trace_filter_publicr   types.trace_page_publicr   types.trace_publicr   types.trace_threadr   types.trace_thread_filterr   types.trace_thread_pager   types.trace_thread_updater   types.trace_updater   types.trace_writer   types.value_entryr   
raw_clientr   r   castAnyr  r   r  r  r(   r&   <module>rZ     s      G 1 # ( 3 D Q H = 3 > ; 9 5 , , 9 5 9 , * * = v{{6::s#u up1_ _r(   