
    jnw                        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mZ ddlmZ  e j>                  e j@                  d      Z! G d d      Z" G d d      Z#y)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)JsonNode)LocalRunner)LocalRunnerConnectResponse)LocalRunnerHeartbeatResponse)LocalRunnerJob)LocalRunnerJobMetadata)LocalRunnerJobPage)LocalRunnerLogEntry)LocalRunnerPage)LocalRunnerPairResponse   )AsyncRawRunnersClientRawRunnersClient)!LocalRunnerJobResultRequestStatus.c                      e Zd ZdefdZedefd       Zddddede	j                  e   d	e	j                  e   de	j                  e   fd
Zdddede	j                   e   d	e	j                  e   ddfdZddded	e	j                  e   ddfdZdddeded	e	j                  e   defdZeeeddde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d	e	j                  e   defdZddded	e	j                  e   defdZddded	e	j                  e   defdZddded	e	j                  e   defdZ ddddddede	j                  e   de	j                  e   d e	j                  e   d	e	j                  e   de!fd!Z"dddd"dede	j                  e   d e	j                  e   d	e	j                  e   de#f
d#Z$ddded	e	j                  e   defd$Z%dddede	jL                  ee	j                  e	jN                     f   d	e	j                  e   ddfd%Z(eeedd&ded'e)d(e	j                  e   d)e	j                  e   d*e	j                  e   d	e	j                  e   ddfd+Z*y),RunnersClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     u/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/runners/client.py__init__zRunnersClient.__init__   s    +>J    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawRunnersClient
        r   r   s    r   with_raw_responsezRunnersClient.with_raw_response        r   Noffsetrequest_optionsjob_idr'   r(   c                V    | j                   j                  |||      }|j                  S )a7  
        Get log entries for a local runner job

        Parameters
        ----------
        job_id : str

        offset : typing.Optional[int]

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

        Returns
        -------
        typing.List[LocalRunnerLogEntry]
            Log entries

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.get_job_logs(job_id='jobId', )
        r&   r   get_job_logsdatar   r)   r'   r(   	_responses        r   r,   zRunnersClient.get_job_logs'   s,    < $$11&Yh1i	~~r   r(   requestc                V    | j                   j                  |||      }|j                  S )a  
        Append log entries for a running local runner job

        Parameters
        ----------
        job_id : str

        request : typing.Sequence[LocalRunnerLogEntry]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import LocalRunnerLogEntry
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.append_job_logs(job_id='jobId', request=[LocalRunnerLogEntry(stream='stream', text='text', )], )
        r1   r(   r   append_job_logsr-   r   r)   r1   r(   r/   s        r   r5   zRunnersClient.append_job_logsH   s,    < $$44VW^m4n	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Cancel a pending or running local runner job

        Parameters
        ----------
        job_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.runners.cancel_job(job_id='jobId', )
        r0   r   
cancel_jobr-   r   r)   r(   r/   s       r   r9   zRunnersClient.cancel_jobi   s)    * $$///X	~~r   pairing_coderunner_namec                V    | j                   j                  |||      }|j                  S )as  
        Exchange a pairing code or API key for local runner credentials

        Parameters
        ----------
        pairing_code : str

        runner_name : str

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

        Returns
        -------
        LocalRunnerConnectResponse
            Runner connected

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.connect_runner(pairing_code='pairing_code', runner_name='runner_name', )
        r;   r<   r(   r   connect_runnerr-   r   r;   r<   r(   r/   s        r   r@   zRunnersClient.connect_runner   s3    4 $$33%;P_ 4 
	 ~~r   inputsmask_idmetadatar(   
agent_name
project_idrC   rD   rE   c                \    | j                   j                  ||||||      }|j                  S )a  
        Create a local runner job and enqueue it for execution

        Parameters
        ----------
        agent_name : str

        project_id : str

        inputs : typing.Optional[JsonNode]

        mask_id : typing.Optional[str]

        metadata : typing.Optional[LocalRunnerJobMetadata]

        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.runners.create_job(agent_name='agent_name', project_id='project_id', )
        rF   rG   rC   rD   rE   r(   r   
create_jobr-   r   rF   rG   rC   rD   rE   r(   r/   s           r   rK   zRunnersClient.create_job   s>    L $$//!!+ 0 
	 ~~r   c                T    | j                   j                  ||      }|j                  S )aE  
        Generate a pairing code for a local runner in the current workspace

        Parameters
        ----------
        project_id : str

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

        Returns
        -------
        LocalRunnerPairResponse
            Pairing code generated

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.generate_pairing_code(project_id='project_id', )
        rG   r(   r   generate_pairing_coder-   r   rG   r(   r/   s       r   rP   z#RunnersClient.generate_pairing_code   s*    0 $$::jbq:r	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Get a single local runner job's status and results

        Parameters
        ----------
        job_id : str

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

        Returns
        -------
        LocalRunnerJob
            Job details

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.get_job(job_id='jobId', )
        r0   r   get_jobr-   r:   s       r   rT   zRunnersClient.get_job   s)    , $$,,V_,U	~~r   	runner_idc                T    | j                   j                  ||      }|j                  S )a  
        Get a single local runner with its registered agents

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunner
            Runner details

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.get_runner(runner_id='runnerId', )
        r0   r   
get_runnerr-   r   rU   r(   r/   s       r   rX   zRunnersClient.get_runner  s)    , $$//	?/[	~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Refresh local runner heartbeat

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunnerHeartbeatResponse
            Heartbeat response

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.heartbeat(runner_id='runnerId', )
        r0   r   	heartbeatr-   rY   s       r   r\   zRunnersClient.heartbeat  s)    0 $$..y/.Z	~~r   rG   pagesizer(   r^   r_   c                Z    | j                   j                  |||||      }|j                  S )aq  
        List jobs for a local runner

        Parameters
        ----------
        runner_id : str

        project_id : typing.Optional[str]

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        LocalRunnerJobPage
            Jobs list

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.list_jobs(runner_id='runnerId', )
        r]   r   	list_jobsr-   r   rU   rG   r^   r_   r(   r/   s          r   rb   zRunnersClient.list_jobs8  s8    H $$..*4dTc / 
	 ~~r   r^   r_   r(   c                X    | j                   j                  ||||      }|j                  S )an  
        List local runners owned by the current user in the workspace

        Parameters
        ----------
        project_id : str

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        LocalRunnerPage
            Runners list

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.list_runners(project_id='project_id', )
        r]   r   list_runnersr-   r   rG   r^   r_   r(   r/   s         r   rg   zRunnersClient.list_runnersa  s5    B $$11!4 2 
	 ~~r   c                T    | j                   j                  ||      }|j                  S )a  
        Long-poll for the next pending local runner job

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunnerJob
            Job available

        Examples
        --------
        from Opik import OpikApi
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.runners.next_job(runner_id='runnerId', )
        r0   r   next_jobr-   rY   s       r   rk   zRunnersClient.next_job  s)    , $$--i-Y	~~r   c                V    | j                   j                  |||      }|j                  S )aV  
        Register or update the local runner's agent list

        Parameters
        ----------
        runner_id : str

        request : typing.Dict[str, typing.Optional[typing.Any]]

        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.runners.register_agents(runner_id='runnerId', request={'key': 'value'
        }, )
        r3   r   register_agentsr-   r   rU   r1   r(   r/   s        r   rn   zRunnersClient.register_agents  s,    < $$44Yap4q	~~r   resulterrortrace_idr(   statusrq   rr   rs   c                \    | j                   j                  ||||||      }|j                  S )a  
        Report local runner job completion or failure

        Parameters
        ----------
        job_id : str

        status : LocalRunnerJobResultRequestStatus

        result : typing.Optional[JsonNode]

        error : typing.Optional[str]

        trace_id : 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.runners.report_job_result(job_id='jobId', status="pending", )
        rt   rq   rr   rs   r(   r   report_job_resultr-   r   r)   rt   rq   rr   rs   r(   r/   s           r   rx   zRunnersClient.report_job_result  s:    L $$666&bq 7 
	 ~~r   )+__name__
__module____qualname__r   r   propertyr   r$   strtypingOptionalintr   Listr   r,   Sequencer5   r9   r	   r@   OMITr   r   rK   r   rP   r   rT   r   rX   r
   r\   r   rb   r   rg   rk   DictAnyrn   r   rx    r   r   r   r      s   K*; K  #3     (,;? $	
  8 
(	)L <@ !45	
  8 
B ]a  &//.:Y ei 2 jn"14GMWeGf	#H -1(,<@;?. . 	.
 ). %. //"89.  8. 
.b VZ 39??>3R	 6 Z^ c v~7V bp 2 `d C V__^=\ hs 4 UY28//.2Q	%> ,0%)%);?'' OOC(	'
 ooc"' ooc"'  8' 
'Z &*%);?$ $ ooc"	$
 ooc"$  8$ 
$L ^b # 6??>;Z ft < <@ S&//&**"==>	
  8 
L -1&*)-;?)) 2	)
 )) s#) //#&)  8) 
)r   r   c                      e Zd ZdefdZedefd       Zddddede	j                  e   d	e	j                  e   de	j                  e   fd
Zdddede	j                   e   d	e	j                  e   ddfdZddded	e	j                  e   ddfdZdddeded	e	j                  e   defdZeeeddde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d	e	j                  e   defdZddded	e	j                  e   defdZddded	e	j                  e   defdZddded	e	j                  e   defdZ ddddddede	j                  e   de	j                  e   d e	j                  e   d	e	j                  e   de!fd!Z"dddd"dede	j                  e   d e	j                  e   d	e	j                  e   de#f
d#Z$ddded	e	j                  e   defd$Z%dddede	jL                  ee	j                  e	jN                     f   d	e	j                  e   ddfd%Z(eeedd&ded'e)d(e	j                  e   d)e	j                  e   d*e	j                  e   d	e	j                  e   ddfd+Z*y),AsyncRunnersClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncRunnersClient.__init__  s    0Or   r    c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawRunnersClient
        r"   r#   s    r   r$   z$AsyncRunnersClient.with_raw_response  r%   r   Nr&   r)   r'   r(   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Get log entries for a local runner job

        Parameters
        ----------
        job_id : str

        offset : typing.Optional[int]

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

        Returns
        -------
        typing.List[LocalRunnerLogEntry]
            Log entries

        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.runners.get_job_logs(job_id='jobId', )
        asyncio.run(main())
        r&   Nr+   r.   s        r   r,   zAsyncRunnersClient.get_job_logs  s:     B **77v_n7oo	~~ p   "757r0   r1   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Append log entries for a running local runner job

        Parameters
        ----------
        job_id : str

        request : typing.Sequence[LocalRunnerLogEntry]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import LocalRunnerLogEntry
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.runners.append_job_logs(job_id='jobId', request=[LocalRunnerLogEntry(stream='stream', text='text', )], )
        asyncio.run(main())
        r3   Nr4   r6   s        r   r5   z"AsyncRunnersClient.append_job_logs   s:     B **::67ds:tt	~~ ur   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aI  
        Cancel a pending or running local runner job

        Parameters
        ----------
        job_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.runners.cancel_job(job_id='jobId', )
        asyncio.run(main())
        r0   Nr8   r:   s       r   r9   zAsyncRunnersClient.cancel_jobD  s6     0 **55fo5^^	~~ _   !646r;   r<   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Exchange a pairing code or API key for local runner credentials

        Parameters
        ----------
        pairing_code : str

        runner_name : str

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

        Returns
        -------
        LocalRunnerConnectResponse
            Runner connected

        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.runners.connect_runner(pairing_code='pairing_code', runner_name='runner_name', )
        asyncio.run(main())
        r>   Nr?   rA   s        r   r@   z!AsyncRunnersClient.connect_runner_  sA     : **99%;P_ : 
 
	 ~~
r   rB   rF   rG   rC   rD   rE   c                x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a#  
        Create a local runner job and enqueue it for execution

        Parameters
        ----------
        agent_name : str

        project_id : str

        inputs : typing.Optional[JsonNode]

        mask_id : typing.Optional[str]

        metadata : typing.Optional[LocalRunnerJobMetadata]

        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.runners.create_job(agent_name='agent_name', project_id='project_id', )
        asyncio.run(main())
        rI   NrJ   rL   s           r   rK   zAsyncRunnersClient.create_job  sL     R **55!!+ 6 
 
	 ~~
   %:8:c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Generate a pairing code for a local runner in the current workspace

        Parameters
        ----------
        project_id : str

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

        Returns
        -------
        LocalRunnerPairResponse
            Pairing code generated

        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.runners.generate_pairing_code(project_id='project_id', )
        asyncio.run(main())
        rN   NrO   rQ   s       r   rP   z(AsyncRunnersClient.generate_pairing_code  s7     6 **@@Jhw@xx	~~ yr   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)an  
        Get a single local runner job's status and results

        Parameters
        ----------
        job_id : str

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

        Returns
        -------
        LocalRunnerJob
            Job details

        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.runners.get_job(job_id='jobId', )
        asyncio.run(main())
        r0   NrS   r:   s       r   rT   zAsyncRunnersClient.get_job  s6     2 **226?2[[	~~ \r   rU   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a|  
        Get a single local runner with its registered agents

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunner
            Runner details

        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.runners.get_runner(runner_id='runnerId', )
        asyncio.run(main())
        r0   NrW   rY   s       r   rX   zAsyncRunnersClient.get_runner  s7     6 **55iQ`5aa	~~ br   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)az  
        Refresh local runner heartbeat

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunnerHeartbeatResponse
            Heartbeat response

        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.runners.heartbeat(runner_id='runnerId', )
        asyncio.run(main())
        r0   Nr[   rY   s       r   r\   zAsyncRunnersClient.heartbeat  s7     6 **44YP_4``	~~ ar   r]   r^   r_   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        List jobs for a local runner

        Parameters
        ----------
        runner_id : str

        project_id : typing.Optional[str]

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        LocalRunnerJobPage
            Jobs list

        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.runners.list_jobs(runner_id='runnerId', )
        asyncio.run(main())
        r]   Nra   rc   s          r   rb   zAsyncRunnersClient.list_jobs*  sF     N **44*4dTc 5 
 
	 ~~
s   $979rd   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        List local runners owned by the current user in the workspace

        Parameters
        ----------
        project_id : str

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        LocalRunnerPage
            Runners list

        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.runners.list_runners(project_id='project_id', )
        asyncio.run(main())
        r]   Nrf   rh   s         r   rg   zAsyncRunnersClient.list_runnersV  sC     H **77!4 8 
 
	 ~~
s   #868c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)aw  
        Long-poll for the next pending local runner job

        Parameters
        ----------
        runner_id : str

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

        Returns
        -------
        LocalRunnerJob
            Job available

        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.runners.next_job(runner_id='runnerId', )
        asyncio.run(main())
        r0   Nrj   rY   s       r   rk   zAsyncRunnersClient.next_job  s6     6 **33I3__	~~ `r   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Register or update the local runner's agent list

        Parameters
        ----------
        runner_id : str

        request : typing.Dict[str, typing.Optional[typing.Any]]

        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.runners.register_agents(runner_id='runnerId', request={'key': 'value'
            }, )
        asyncio.run(main())
        r3   Nrm   ro   s        r   rn   z"AsyncRunnersClient.register_agents  s:     B **::9ggv:ww	~~ xr   rp   rt   rq   rr   rs   c                x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a  
        Report local runner job completion or failure

        Parameters
        ----------
        job_id : str

        status : LocalRunnerJobResultRequestStatus

        result : typing.Optional[JsonNode]

        error : typing.Optional[str]

        trace_id : 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.runners.report_job_result(job_id='jobId', status="pending", )
        asyncio.run(main())
        rv   Nrw   ry   s           r   rx   z$AsyncRunnersClient.report_job_result  sH     R **<<6&bq = 
 
	 ~~
r   )+rz   r{   r|   r   r   r}   r   r$   r~   r   r   r   r   r   r   r,   r   r5   r9   r	   r@   r   r   r   rK   r   rP   r   rT   r   rX   r
   r\   r   rb   r   rg   rk   r   r   rn   r   rx   r   r   r   r   r     s&   P*< P  #8     (,;?"" $	"
  8" 
(	)"R <@"" !45	"
  8" 
"H cg s P^@_ ko 8 jn " 14 GMWeGf 	# N -1(,<@;?1 1 	1
 )1 %1 //"891  81 
1h VZ 39??>3R	 < `d C V__^=\ hv : UY28//.2Q	> UY28//.2Q	%D ,0%)%);?** OOC(	*
 ooc"* ooc"*  8* 
*` &*%);?' ' ooc"	'
 ooc"'  8' 
'T UY28//.2Q	F <@"" S&//&**"==>	"
  8" 
"R -1&*)-;?,, 2	,
 ), s#, //#&,  8, 
,r   r   )$r   core.client_wrapperr   r   core.request_optionsr   types.json_noder   types.local_runnerr   #types.local_runner_connect_responser	   %types.local_runner_heartbeat_responser
   types.local_runner_jobr   types.local_runner_job_metadatar   types.local_runner_job_pager   types.local_runner_log_entryr   types.local_runner_pager    types.local_runner_pair_responser   
raw_clientr   r   ,types.local_runner_job_result_request_statusr   castr   r   r   r   r   r   r   <module>r      se     G 1 & , L P 3 D < > 5 F ? [ v{{6::s#R Rj@ @r   