
    ]j?$                        d dl m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mZ ej                  rdd	lmZmZ  ej"                  ej$                  d
      Z G d d      Z G d d      Zy)    )annotationsN   )AsyncClientWrapperSyncClientWrapper)RequestOptions)MetricParam   )AsyncRawMetricsClientRawMetricsClient)AsyncCustomClientCustomClient.c                  t    e Zd Zd	dZed
d       ZddddZeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZed        Z	y)MetricsClientc               B    t        |      | _        || _        d | _        y Nclient_wrapper)r   _raw_client_client_wrapper_customselfr   s     R/root/env/lib/python3.12/site-packages/label_studio_sdk/projects/metrics/client.py__init__zMetricsClient.__init__   s    +>J-6:    c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawMetricsClient
        r   r   s    r   with_raw_responsezMetricsClient.with_raw_response        r   Nrequest_optionsc               T    | j                   j                  ||      }|j                  S )a"  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get the current metrics configuration for a project.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        MetricParam
            Current metrics configuration

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.metrics.get(
            id=1,
        )
        r!   r   getdatar   idr"   	_responses       r   r%   zMetricsClient.get#   s*    B $$((_(M	~~r   additional_paramsagreement_threshold$max_additional_annotators_assignablemetric_namer"   c               \    | j                   j                  ||||||      }|j                  S )a[  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update metrics strategy and parameters for a project.

        Parameters
        ----------
        id : int

        additional_params : typing.Optional[typing.Dict[str, typing.Any]]
            Agreement metric parameters

        agreement_threshold : typing.Optional[int]

        max_additional_annotators_assignable : typing.Optional[int]

        metric_name : typing.Optional[str]
            Agreement metric

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

        Returns
        -------
        MetricParam
            Updated metrics configuration

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.metrics.update(
            id=1,
        )
        r*   r   updater&   r   r(   r+   r,   r-   r.   r"   r)   s           r   r1   zMetricsClient.updateG   s>    h $$++/ 31U#+ , 
	 ~~r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   custom.clientr   r   )r   r   s     r   customzMetricsClient.custom   s+    <<3't7K7KLDL||r   )r   r   )returnr   r(   intr"   typing.Optional[RequestOptions]r6   r   r(   r8   r+   z-typing.Optional[typing.Dict[str, typing.Any]]r,   typing.Optional[int]r-   r;   r.   ztyping.Optional[str]r"   r9   r6   r   
__name__
__module____qualname__r   propertyr   r%   OMITr1   r5    r   r   r   r      s    ;
     RV "P LP48EI,0;?<< I	<
 2< /C< *< 9< 
<|  r   r   c                  t    e Zd Zd	dZed
d       ZddddZeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZed        Z	y)AsyncMetricsClientc               B    t        |      | _        || _        d | _        y r   )r
   r   r   r   r   s     r   r   zAsyncMetricsClient.__init__   s    0O-;?r   c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawMetricsClient
        r   r   s    r   r   z$AsyncMetricsClient.with_raw_response   r    r   Nr!   c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Get the current metrics configuration for a project.

        Parameters
        ----------
        id : int

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

        Returns
        -------
        MetricParam
            Current metrics configuration

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.metrics.get(
                id=1,
            )


        asyncio.run(main())
        r!   Nr$   r'   s       r   r%   zAsyncMetricsClient.get   s7     R **..r?.SS	~~ Ts   !646r*   c               x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Update metrics strategy and parameters for a project.

        Parameters
        ----------
        id : int

        additional_params : typing.Optional[typing.Dict[str, typing.Any]]
            Agreement metric parameters

        agreement_threshold : typing.Optional[int]

        max_additional_annotators_assignable : typing.Optional[int]

        metric_name : typing.Optional[str]
            Agreement metric

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

        Returns
        -------
        MetricParam
            Updated metrics configuration

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.metrics.update(
                id=1,
            )


        asyncio.run(main())
        r*   Nr0   r2   s           r   r1   zAsyncMetricsClient.update   sL     x **11/ 31U#+ 2 
 
	 ~~
s   %:8:c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr	   )r   r   )r   r4   r   r   )r   r   s     r   r5   zAsyncMetricsClient.custom  s+    <<8,D<P<PQDL||r   )r   r   )r6   r
   r7   r:   r<   rB   r   r   rD   rD      s    @
     X\ *` LP48EI,0;?DD I	D
 2D /CD *D 9D 
DL  r   rD   )
__future__r   typingcore.client_wrapperr   r   core.request_optionsr   types.metric_paramr   
raw_clientr
   r   TYPE_CHECKINGr4   r   r   castAnyrA   r   rD   rB   r   r   <module>rS      sT    #  H 2 - ?	>v{{6::s#y yxI Ir   