
    j                         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	m
Z
  e j                  e j                  d      Z G d	 d
      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)GuardrailWrite   )AsyncRawGuardrailsClientRawGuardrailsClient.c                   |    e Zd ZdefdZedefd       Zdddej                  e
   dej                  e   ddfd	Zy)
GuardrailsClientclient_wrapperc                &    t        |      | _        y N)r   )r
   _raw_clientselfr   s     x/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/guardrails/client.py__init__zGuardrailsClient.__init__   s    .nM    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawGuardrailsClient
        r   r   s    r   with_raw_responsez"GuardrailsClient.with_raw_response        r   Nrequest_options
guardrailsr   c                T    | j                   j                  ||      }|j                  S )a  
        Batch guardrails for traces

        Parameters
        ----------
        guardrails : typing.Sequence[GuardrailWrite]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import OpikApi
        from Opik import GuardrailWrite
        client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        client.guardrails.create_guardrails(guardrails=[GuardrailWrite(entity_id='entity_id', secondary_id='secondary_id', name="TOPIC", result="passed", config={'key': 'value'
        }, details={'key': 'value'
        }, )], )
        r   r   r   create_guardrailsdatar   r   r   	_responses       r   r"   z"GuardrailsClient.create_guardrails   s*    4 $$66*^m6n	~~r   )__name__
__module____qualname__r   r   propertyr
   r   typingSequencer   Optionalr   r"    r   r   r   r      sd    N*; N  #6     rv#__^<OU_mOn	r   r   c                   |    e Zd ZdefdZedefd       Zdddej                  e
   dej                  e   ddfd	Zy)
AsyncGuardrailsClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   zAsyncGuardrailsClient.__init__<   s    3>Rr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawGuardrailsClient
        r   r   s    r   r   z'AsyncGuardrailsClient.with_raw_response?   r   r   Nr   r   r   c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a9  
        Batch guardrails for traces

        Parameters
        ----------
        guardrails : typing.Sequence[GuardrailWrite]

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

        Returns
        -------
        None

        Examples
        --------
        from Opik import AsyncOpikApi
        from Opik import GuardrailWrite
        import asyncio
        client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
        async def main() -> None:
            await client.guardrails.create_guardrails(guardrails=[GuardrailWrite(entity_id='entity_id', secondary_id='secondary_id', name="TOPIC", result="passed", config={'key': 'value'
            }, details={'key': 'value'
            }, )], )
        asyncio.run(main())
        r    Nr!   r$   s       r   r"   z'AsyncGuardrailsClient.create_guardrailsJ   s7     : **<<
ds<tt	~~ us   !646)r&   r'   r(   r   r   r)   r	   r   r*   r+   r   r,   r   r"   r-   r   r   r/   r/   ;   sd    S*< S  #;     rv#__^<OU_mOn	r   r/   )r*   core.client_wrapperr   r   core.request_optionsr   types.guardrail_writer   
raw_clientr	   r
   castAnyOMITr   r/   r-   r   r   <module>r:      sC     G 1 2 E v{{6::s#* *Z- -r   