
    ]j                         d dl Z d dlmZ ddlmZ ddlmZm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  e j2                  e j4                  d      Z G d d      Z G d d      Zy)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type)InferenceRunCostEstimate)ProviderEnum)RefinedPromptResponse)ThirdPartyModelVersion.c                   ,   e Zd ZdefdZdddedej                  e   de	d   fdZ
ddd	d
edej                  e   dej                  e   de	ej                  e      fdZ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   dej                  e   dej                  e   de	e   fdZddd
ededej                  e   de	e   fdZddd
ededej                  e   de	d   fdZeeee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ej                  e   dej                  e   dej                  e   dej                  e   de	e   fdZddd
ededej                  e   de	e   fdZdddd
ededej                  e   dej                  e   de	e   f
dZdddd
eded ed!ed"ed#ej                  e   dej                  e   de	e   fd$Zy)%RawVersionsClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     V/root/env/lib/python3.12/site-packages/label_studio_sdk/prompts/versions/raw_client.py__init__zRawVersionsClient.__init__   
    -    Nrequest_optionsidr   returnc                   | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY 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 default prompt version name

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

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

        Returns
        -------
        HttpResponse[None]
        api/prompts//get-default-version-nameGETmethodr      ,  Nresponsedatastatus_codeheadersbodyr   httpx_clientrequestr
   r.   r	   jsonr   r   dictr/   textr   r    r   	_response_response_jsons        r   get_default_version_namez*RawVersionsClient.get_default_version_name   s    . ((55==+B/00IJ+ > 
	
	ti++1c1#YTBB&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   $B B ?Corderingr   	prompt_idr<   c                j   | j                   j                  j                  dt        |       ddd|i|      }	 d|j                  cxk  rdk  rin nft        j                  t
        j                  t           t        t
        j                  t           |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                   
      w xY 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>
        List all versions of a prompt.

        Parameters
        ----------
        prompt_id : int

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        HttpResponse[typing.List[ThirdPartyModelVersion]]

        r#   	/versionsr%   r<   r'   paramsr   r(   r)   type_object_r*   r-   )r   r2   r3   r
   r.   typingcastListr   r   r4   r	   r   r   r5   r/   r6   r   r=   r<   r   r8   _datar9   s          r   listzRawVersionsClient.list=   s   > ((55==+I67yAH , > 
		ti++1c1KK 67"$kk*@A ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   A=C3 8C3 3?D2model_provider_connectionorganizationparent_modelproviderr   promptprovider_model_idtitlerL   rM   rN   rO   c                B   | j                   j                  j                  dt        |       dd|||||||dddi|	t              }
	 d|
j
                  cxk  rd	k  rGn nDt        j                  t        t        t        |
j                         
            }t        |
|      S |
j                         }t        |
j
                  t        |
j                        |      # t        $ r6 t        |
j
                  t        |
j                        |
j                         w xY 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>
        Create a new version of a prompt.

        Parameters
        ----------
        prompt_id : int

        prompt : str
            Prompt to execute

        provider_model_id : str
            The model ID to use within the given provider, e.g. gpt-3.5

        title : str
            Model name

        model_provider_connection : typing.Optional[int]

        organization : typing.Optional[int]

        parent_model : typing.Optional[int]
            Parent model interface ID

        provider : typing.Optional[ProviderEnum]
            The model provider to use e.g. OpenAI

            * `OpenAI` - OpenAI
            * `AzureOpenAI` - AzureOpenAI
            * `AzureAIFoundry` - AzureAIFoundry
            * `VertexAI` - VertexAI
            * `Gemini` - Gemini
            * `Anthropic` - Anthropic
            * `Custom` - Custom

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

        Returns
        -------
        HttpResponse[ThirdPartyModelVersion]

        r#   r?   POSTrL   rM   rN   rP   rO   rQ   rR   content-typeapplication/jsonr'   r4   r/   r   omitr(   r)   rB   r*   r-   r   r2   r3   r
   OMITr.   rE   rF   r   r   r4   r	   r   r   r5   r/   r6   r   r=   rP   rQ   rR   rL   rM   rN   rO   r   r8   rI   r9   s                r   createzRawVersionsClient.creates   s"   z ((55==+I67yA-F , , $%6  2 ,! > 
	$	ti++1c1*"4 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC $C ?D
version_idc                6   | j                   j                  j                  dt        |       dt        |       d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
aC  
        <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>
        Retrieve a specific prompt of a model.

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        HttpResponse[ThirdPartyModelVersion]

        r#   
/versions/r%   r&   r(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r	   r   r   r5   r/   r6   r   r=   r^   r   r8   rI   r9   s          r   getzRawVersionsClient.get   s   4 ((55==+I67zBRS]B^A_`+ > 
	
	ti++1c1*"4 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Dc                   | j                   j                  j                  dt        |       dt        |       d|      }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY 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>
        Delete a prompt version by ID

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        HttpResponse[None]
        r#   r`   DELETEr&   r(   r)   Nr*   r-   r1   r   r=   r^   r   r8   r9   s         r   deletezRawVersionsClient.delete   s    2 ((55==+I67zBRS]B^A_`+ > 
	
	ti++1c1#YTBB&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   $B" 'B" "?C!rL   rM   rN   rP   rO   rQ   rR   r   c                X   | j                   j                  j                  dt        |       dt        |       d|||||||	dddi|
t              }	 d|j
                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j
                  t        |j                        |      # t        $ r6 t        |j
                  t        |j                        |j                         w xY w)ac  
        <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 a specific prompt version by ID.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        model_provider_connection : typing.Optional[int]

        organization : typing.Optional[int]

        parent_model : typing.Optional[int]
            Parent model interface ID

        prompt : typing.Optional[str]
            Prompt to execute

        provider : typing.Optional[ProviderEnum]
            The model provider to use e.g. OpenAI

            * `OpenAI` - OpenAI
            * `AzureOpenAI` - AzureOpenAI
            * `AzureAIFoundry` - AzureAIFoundry
            * `VertexAI` - VertexAI
            * `Gemini` - Gemini
            * `Anthropic` - Anthropic
            * `Custom` - Custom

        provider_model_id : typing.Optional[str]
            The model ID to use within the given provider, e.g. gpt-3.5

        title : typing.Optional[str]
            Model name

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

        Returns
        -------
        HttpResponse[ThirdPartyModelVersion]

        r#   r`   PATCHrU   rV   rW   rX   r(   r)   rB   r*   r-   rZ   r   r=   r^   rL   rM   rN   rP   rO   rQ   rR   r   r8   rI   r9   s                 r   updatezRawVersionsClient.update%  s.   @ ((55==+I67zBRS]B^A_`-F , , $%6  2 ,! > 
	$	ti++1c1*"4 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC* /C* *?D)c                8   | j                   j                  j                  dt        |       dt        |       dd|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY 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 an estimate of the cost for making an inference run on the selected Prompt Version and Project/ProjectSubset

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        HttpResponse[InferenceRunCostEstimate]
            Cost estimate response
        r#   r`   /cost-estimater%   r&   r(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r	   r   r   r5   r/   r6   ra   s          r   cost_estimatezRawVersionsClient.cost_estimate  s   4 ((55==+I67zBRS]B^A__mn+ > 
	
	ti++1c1,"6 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Drefinement_job_idr   rq   c                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY 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 refined prompt based on the `refinement_job_id`.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        refinement_job_id : typing.Optional[str]
            Refinement Job ID acquired from the `POST /api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint

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

        Returns
        -------
        HttpResponse[RefinedPromptResponse]
            Refined prompt response
        r#   r`   /refiner%   rq   r@   r(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r	   r   r   r5   r/   r6   r   r=   r^   rq   r   r8   rI   r9   s           r   get_refined_promptz$RawVersionsClient.get_refined_prompt  s   D ((55==+I67zBRS]B^A__fg#%6 , > 
		ti++1c1)"3 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC "C ?Dasync_r   
project_idteacher_model_name$teacher_model_provider_connection_idrw   c          	      X   | j                   j                  j                  dt        |       dt        |       ddd|i|||dddi|t        	      }	 d
|j
                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }	t        ||	      S |j                         }
t        |j
                  t        |j                        |
      # t        $ r6 t        |j
                  t        |j                        |j                         w xY 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>
        Refine a prompt version using a teacher model and save the refined prompt as a new version.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        project_id : int
            Project ID to target the refined prompt for

        teacher_model_name : str
            Name of the model to use to refine the prompt

        teacher_model_provider_connection_id : int
            Model Provider Connection ID to use to refine the prompt

        async_ : typing.Optional[bool]
            Whether to run the refinement asynchronously

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

        Returns
        -------
        HttpResponse[RefinedPromptResponse]
            Refined prompt response
        r#   r`   rs   rT   asyncrx   ry   rz   rV   rW   r'   rA   r4   r/   r   rY   r(   r)   rB   r*   r-   )r   r2   r3   r
   r[   r.   rE   rF   r   r   r4   r	   r   r   r5   r/   r6   r   r=   r^   rx   ry   rz   rw   r   r8   rI   r9   s              r   refine_promptzRawVersionsClient.refine_prompt  s1   \ ((55==+I67zBRS]B^A__fg )&88\  2 , > 
	"	ti++1c1)"3 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trl   )__name__
__module____qualname__r   r   intrE   Optionalr   r	   r:   strrG   r   rJ   r[   r   r]   rb   rf   rk   r   ro   r   ru   boolr    r   r   r   r      s   .*; . NR"p"p+1??>+J"p	d	"pP *.;?4p4p //#&	4p
  84p 
fkk"89	:4pz ;?-1-126;?\p\p 	\p
 \p \p $*??3#7\p ooc*\p ooc*\p //,/\p  8\p 
,	-\p~ fj,p,p*-,pCI??SaCb,p	,	-,p^ fj$p$p*-$pCI??SaCb$p	d	$pV ;?-1-1'+2626&*;?_p_p _p
 $*??3#7_p ooc*_p ooc*_p $_p //,/_p "??3/_p s#_p  8_p 
,	-_pD fj,p,p*-,pCI??SaCb,p	.	/,pf 37;?7p7p 7p
 "??3/7p  87p 
+	,7pB )-;?LpLp Lp
 Lp  Lp /2Lp %Lp  8Lp 
+	,Lpr   r   c                   ,   e Zd ZdefdZdddedej                  e   de	d   fdZ
ddd	d
edej                  e   dej                  e   de	ej                  e      fdZ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   dej                  e   dej                  e   de	e   fdZddd
ededej                  e   de	e   fdZddd
ededej                  e   de	d   fdZeeee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ej                  e   dej                  e   dej                  e   dej                  e   de	e   fdZddd
ededej                  e   de	e   fdZdddd
ededej                  e   dej                  e   de	e   f
dZdddd
eded ed!ed"ed#ej                  e   dej                  e   de	e   fd$Zy)%AsyncRawVersionsClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawVersionsClient.__init__=  r   r   Nr   r    r   r!   c                  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      7 e# t        $ r6 t        |j                  t        |j                        |j                  	      w xY w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 default prompt version name

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

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

        Returns
        -------
        AsyncHttpResponse[None]
        r#   r$   r%   r&   Nr(   r)   r*   r-   r   r2   r3   r
   r.   r   r4   r   r   r5   r/   r6   r7   s        r   r:   z/AsyncRawVersionsClient.get_default_version_name@  s     . ..;;CC+B/00IJ+ D 
 
	
	ti++1c1()$GG&^^-N 9#8#8$yGXGXBY`noo
  	ty'<'<d9K\K\F]dmdrdrss	ts3   9C%B!C%$B# %C%&B# 6,C%#?C""C%r;   r=   r<   c                  K   | j                   j                  j                  dt        |       ddd|i|       d{   }	 d|j                  cxk  rdk  rin nft        j                  t
        j                  t           t        t
        j                  t           |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                         w xY w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>
        List all versions of a prompt.

        Parameters
        ----------
        prompt_id : int

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

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

        Returns
        -------
        AsyncHttpResponse[typing.List[ThirdPartyModelVersion]]

        r#   r?   r%   r<   r@   Nr(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   rG   r   r   r4   r   r   r   r5   r/   r6   rH   s          r   rJ   zAsyncRawVersionsClient.listd  s#    > ..;;CC+I67yAH , D 
 
		ti++1c1KK 67"$kk*@A ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	ts4   <EC=EA=C? EC? ,E??D>>ErK   rP   rQ   rR   rL   rM   rN   rO   c                ^  K   | j                   j                  j                  dt        |       dd|||||||dddi|	t               d{   }
	 d	|
j
                  cxk  rd
k  rGn nDt        j                  t        t        t        |
j                                     }t        |
|      S |
j                         }t        |
j
                  t        |
j                        |      7 # t        $ r6 t        |
j
                  t        |
j                        |
j                         w xY w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>
        Create a new version of a prompt.

        Parameters
        ----------
        prompt_id : int

        prompt : str
            Prompt to execute

        provider_model_id : str
            The model ID to use within the given provider, e.g. gpt-3.5

        title : str
            Model name

        model_provider_connection : typing.Optional[int]

        organization : typing.Optional[int]

        parent_model : typing.Optional[int]
            Parent model interface ID

        provider : typing.Optional[ProviderEnum]
            The model provider to use e.g. OpenAI

            * `OpenAI` - OpenAI
            * `AzureOpenAI` - AzureOpenAI
            * `AzureAIFoundry` - AzureAIFoundry
            * `VertexAI` - VertexAI
            * `Gemini` - Gemini
            * `Anthropic` - Anthropic
            * `Custom` - Custom

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

        Returns
        -------
        AsyncHttpResponse[ThirdPartyModelVersion]

        r#   r?   rT   rU   rV   rW   rX   Nr(   r)   rB   r*   r-   r   r2   r3   r
   r[   r.   rE   rF   r   r   r4   r   r   r   r5   r/   r6   r\   s                r   r]   zAsyncRawVersionsClient.create  s0    z ..;;CC+I67yA-F , , $%6  2 ,! D 
 
	$	ti++1c1*"4 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo?
:  	ty'<'<d9K\K\F]dmdrdrss	ts7   A
D-C)D-AC+ -D-.C+ >,D-+?D**D-r^   c                R  K   | j                   j                  j                  dt        |       dt        |       d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)aH  
        <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>
        Retrieve a specific prompt of a model.

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        AsyncHttpResponse[ThirdPartyModelVersion]

        r#   r`   r%   r&   Nr(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r   r   r   r5   r/   r6   ra   s          r   rb   zAsyncRawVersionsClient.get  s    4 ..;;CC+I67zBRS]B^A_`+ D 
 
	
	ti++1c1*"4 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts7   AD'C#D'AC% 'D'(C% 8,D'%?D$$D'c                  K   | j                   j                  j                  dt        |       dt        |       d|       d{   }	 d|j                  cxk  rdk  rn nt        |d      S |j                         }t        |j                  t        |j                        |	      7 e# t        $ r6 t        |j                  t        |j                        |j                  	      w xY w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>
        Delete a prompt version by ID

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        AsyncHttpResponse[None]
        r#   r`   rd   r&   Nr(   r)   r*   r-   r   re   s         r   rf   zAsyncRawVersionsClient.delete&  s     2 ..;;CC+I67zBRS]B^A_`+ D 
 
	
	ti++1c1()$GG&^^-N 9#8#8$yGXGXBY`noo
  	ty'<'<d9K\K\F]dmdrdrss	ts6   AC0B,C0$B. 0C01B. ,C0.?C--C0rg   c                t  K   | j                   j                  j                  dt        |       dt        |       d|||||||	dddi|
t               d{   }	 d	|j
                  cxk  rd
k  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j
                  t        |j                        |      7 # t        $ r6 t        |j
                  t        |j                        |j                         w xY ww)ah  
        <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 a specific prompt version by ID.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        model_provider_connection : typing.Optional[int]

        organization : typing.Optional[int]

        parent_model : typing.Optional[int]
            Parent model interface ID

        prompt : typing.Optional[str]
            Prompt to execute

        provider : typing.Optional[ProviderEnum]
            The model provider to use e.g. OpenAI

            * `OpenAI` - OpenAI
            * `AzureOpenAI` - AzureOpenAI
            * `AzureAIFoundry` - AzureAIFoundry
            * `VertexAI` - VertexAI
            * `Gemini` - Gemini
            * `Anthropic` - Anthropic
            * `Custom` - Custom

        provider_model_id : typing.Optional[str]
            The model ID to use within the given provider, e.g. gpt-3.5

        title : typing.Optional[str]
            Model name

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

        Returns
        -------
        AsyncHttpResponse[ThirdPartyModelVersion]

        r#   r`   ri   rU   rV   rW   rX   Nr(   r)   rB   r*   r-   r   rj   s                 r   rk   zAsyncRawVersionsClient.updateL  s<    @ ..;;CC+I67zBRS]B^A_`-F , , $%6  2 ,! D 
 
	$	ti++1c1*"4 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo?
:  	ty'<'<d9K\K\F]dmdrdrss	t7   AD8C4D8AC6 8D89C6 	,D86?D55D8c                T  K   | j                   j                  j                  dt        |       dt        |       dd|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY w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 an estimate of the cost for making an inference run on the selected Prompt Version and Project/ProjectSubset

        Parameters
        ----------
        prompt_id : int

        version_id : int

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

        Returns
        -------
        AsyncHttpResponse[InferenceRunCostEstimate]
            Cost estimate response
        r#   r`   rn   r%   r&   Nr(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r   r   r   r5   r/   r6   ra   s          r   ro   z$AsyncRawVersionsClient.cost_estimate  s    4 ..;;CC+I67zBRS]B^A__mn+ D 
 
	
	ti++1c1,"6 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts7   AD(C$D(AC& (D()C& 9,D(&?D%%D(rp   rq   c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY w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 refined prompt based on the `refinement_job_id`.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        refinement_job_id : typing.Optional[str]
            Refinement Job ID acquired from the `POST /api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint

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

        Returns
        -------
        AsyncHttpResponse[RefinedPromptResponse]
            Refined prompt response
        r#   r`   rs   r%   rq   r@   Nr(   r)   rB   r*   r-   )r   r2   r3   r
   r.   rE   rF   r   r   r4   r   r   r   r5   r/   r6   rt   s           r   ru   z)AsyncRawVersionsClient.get_refined_prompt  s     D ..;;CC+I67zBRS]B^A__fg#%6 , D 
 
		ti++1c1)"3 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	ts7   AD+
C'D+AC) +D+,C) <,D+)?D((D+rv   rx   ry   rz   rw   c          	      t  K   | j                   j                  j                  dt        |       dt        |       ddd|i|||dddi|t        	       d
{   }	 d|j
                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }	t        ||	      S |j                         }
t        |j
                  t        |j                        |
      7 # t        $ r6 t        |j
                  t        |j                        |j                         w xY w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>
        Refine a prompt version using a teacher model and save the refined prompt as a new version.

        Parameters
        ----------
        prompt_id : int

        version_id : int

        project_id : int
            Project ID to target the refined prompt for

        teacher_model_name : str
            Name of the model to use to refine the prompt

        teacher_model_provider_connection_id : int
            Model Provider Connection ID to use to refine the prompt

        async_ : typing.Optional[bool]
            Whether to run the refinement asynchronously

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

        Returns
        -------
        AsyncHttpResponse[RefinedPromptResponse]
            Refined prompt response
        r#   r`   rs   rT   r|   r}   rV   rW   r~   Nr(   r)   rB   r*   r-   )r   r2   r3   r
   r[   r.   rE   rF   r   r   r4   r   r   r   r5   r/   r6   r   s              r   r   z$AsyncRawVersionsClient.refine_prompt  s?    \ ..;;CC+I67zBRS]B^A__fg )&88\  2 , D 
 
	"	ti++1c1)"3 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo=
8  	ty'<'<d9K\K\F]dmdrdrss	tr   )r   r   r   r   r   r   rE   r   r   r   r:   r   rG   r   rJ   r[   r   r]   rb   rf   rk   r   ro   r   ru   r   r   r   r   r   r   r   <  s   .*< . NR"p"p+1??>+J"p	4	 "pP *.;?4p4p //#&	4p
  84p 
6;;'=>	?4pz ;?-1-126;?\p\p 	\p
 \p \p $*??3#7\p ooc*\p ooc*\p //,/\p  8\p 
1	2\p~ fj,p,p*-,pCI??SaCb,p	1	2,p^ fj$p$p*-$pCI??SaCb$p	4	 $pV ;?-1-1'+2626&*;?_p_p _p
 $*??3#7_p ooc*_p ooc*_p $_p //,/_p "??3/_p s#_p  8_p 
1	2_pD fj,p,p*-,pCI??SaCb,p	3	4,pf 37;?7p7p 7p
 "??3/7p  87p 
0	17pB )-;?LpLp Lp
 Lp  Lp /2Lp %Lp  8Lp 
0	1Lpr   r   )rE   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   !types.inference_run_cost_estimater   types.provider_enumr   types.refined_prompt_responser   types.third_party_model_versionr   rF   Anyr[   r   r   r   r   r   <module>r      s`     ( & H A 5 2 7 I / B E v{{6::s#dp dpNdp dpr   