
    Ngjz                       d Z ddlmZ ddlmZmZmZ ddlmZ ddlm	Z	 ddl
mZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZ 	 dd	lmZmZmZmZmZmZ n# e $ r dd	l!mZmZmZmZmZmZ Y nw xY wdd
lm"Z" eeeedf         Z#eee$df         Z% G d de          Z&ee$eee$e'f         e&f         f         Z(	  G d de          Z) G d de)          Z* G d de)          Z+ G d de)          Z, G d de          Z- G d de$e	          Z. G d de          Z/ G d de/          Z0 G d de          Z1d  Z2 G d! d"e          Z3 G d# d$e3          Z4 G d% d&e$e	          Z5 G d' d(ed)*          Z6 G d+ d,e3          Z7 G d- d.e          Z8 G d/ d0e8          Z9 G d1 d2e8          Z: G d3 d4e	          Z; G d5 d6e          Z< G d7 d8ed)*          Z= G d9 d:ed)*          Z> G d; d<e<          Z? G d= d>e<          Z@ G d? d@e          ZA G dA dBeA          ZBe G dC dDe                      ZC G dE dFed)*          ZD G dG dHe          ZE G dI dJed)*          ZF G dK dLe          ZGe+H                                  G dM dNe          ZI G dO dPe          ZJ G dQ dRed)*          ZK G dS dTed)*          ZL G dU dVe          ZM G dW dXe          ZN G dY dZe          ZO G d[ d\e          ZP G d] d^e          ZQ G d_ d`e          ZR G da dbe$e	          ZS G dc dded)*          ZT G de dfed)*          ZU G dg dhe          ZVdS )izSchemas for the LangSmith API.    )annotations)datetime	timedeltatimezone)Decimal)Enum)	AnyDictList
NamedTupleOptionalProtocolTupleUnionruntime_checkable)UUID)NotRequired	TypedDict)	BaseModelFieldPrivateAttr
StrictBoolStrictFloat	StrictInt)LiteralNc                  (    e Zd ZU dZded<   ded<   dS )
AttachmentaB  Annotated type that will be stored as an attachment if used.

    Examples:
        --------
        .. code-block:: python

        @traceable
        def my_function(bar: int, my_val: Attachment):
            # my_val will be stored as an attachment
            # bar will be stored as inputs
            return bar
    str	mime_typebytesdataN__name__
__module____qualname____doc____annotations__     M/var/www/html/ai-engine/env/lib/python3.11/site-packages/langsmith/schemas.pyr   r   0   s.           NNNKKKKKr)   r   c                      e Zd ZU dZded<    ee          Zded<    ed          Zd	ed
<    ed          Z	d	ed<    G d d          Z
dS )ExampleBasezExample base model.r   
dataset_iddefault_factoryDict[str, Any]inputsNdefaultOptional[Dict[str, Any]]outputsmetadatac                      e Zd ZdZdZdS )ExampleBase.Config#Configuration class for the schema.TNr#   r$   r%   r&   frozenr(   r)   r*   Configr8   N           11r)   r<   )r#   r$   r%   r&   r'   r   dictr1   r5   r6   r<   r(   r)   r*   r,   r,   F   s         "U4888F8888(-d(;(;(;G;;;;).t)<)<)<H<<<<         r)   r,   c                  P    e Zd ZU dZded<    ed           Zded<   dZd	ed
<   dS )ExampleCreatezExample create model.Optional[UUID]idc                 >    t          j        t          j                  S Nr   nowr   utcr(   r)   r*   <lambda>zExampleCreate.<lambda>X       hl9S9S r)   r.   r   
created_atNOptional[Union[str, List[str]]]split)r#   r$   r%   r&   r'   r   rJ   rL   r(   r)   r*   r@   r@   T   sW          51S1STTTJTTTT-1E111111r)   r@   c                  B    e Zd ZU dZded<    ed           Zded<    e ed          	          Zded
<    ed	          Z	ded<    ee
          Zded<   dZded<    ed	          Zded<    ed	          Zded<   	 	 dd fdZedd            Zd Z xZS )ExamplezExample model.r   rB   c                 B    t          j        dt          j                  S )Nr   )tz)r   fromtimestampr   rG   r(   r)   r*   rH   zExample.<lambda>a   s     6qX\ J J J r)   r.   r   rJ   z$00000000-0000-0000-0000-000000000000r2   r-   NOptional[datetime]modified_atz	List[Run]runsrA   source_run_idOptional[str]	_host_url
_tenant_idkwargsr	   returnNonec                V     t                      j        di | || _        || _        dS )Initialize a Dataset object.Nr(   )super__init__rW   rX   )selfrW   rX   rY   	__class__s       r*   r_   zExample.__init__j   s4     	""6""""$r)   c                    | j         rDd| j         d| j         }| j        r | j          dt	          | j                   | S | j          | S dS )URL of this run within the app.
/datasets/z/e//o/N)rW   r-   rB   rX   r   )r`   paths     r*   urlzExample.urlu   so     > 	-===DG==D J.IIS-A-AI4IIIn,d,,,tr)   c                F    | j          d| j         d| j         d| j         dS )5Return a string representation of the RunBase object.(id=z, dataset_id=z, link=''))ra   rB   r-   rg   r`   s    r*   __repr__zExample.__repr__   s3    .aadgaaDOaaUYU]aaaar)   )NN)rW   rV   rX   rA   rY   r	   rZ   r[   rZ   rV   )r#   r$   r%   r&   r'   r   rJ   r   r-   rS   listrT   rU   r   rW   rX   r_   propertyrg   rm   __classcell__ra   s   @r*   rN   rN   \   su        HHH 5JJ  J     uTT*P%Q%QRRRJRRRR&+eD&9&9&9K9999eD111D1111$(M((((*{4888I8888!,T!:!:!:J:::: $(%)	% 	% 	% 	% 	% 	% 	%    Xb b b b b b br)   rN   c                      e Zd ZU dZded<   dS )ExampleSearchzExample returned via search.r   rB   Nr"   r(   r)   r*   rt   rt      s         &&HHHHHr)   rt   c                  t    e Zd ZU dZdZded<   dZded<   dZded<   dZded<   dZ	d	ed
<    G d d          Z
dS )ExampleUpdatezUpdate class for Example.NrA   r-   r4   r1   r5   r6   rK   rL   c                      e Zd ZdZdZdS )ExampleUpdate.Configr9   TNr:   r(   r)   r*   r<   rx      r=   r)   r<   )r#   r$   r%   r&   r-   r'   r1   r5   r6   rL   r<   r(   r)   r*   rv   rv      s         ##!%J%%%%'+F++++(,G,,,,)-H-----1E1111         r)   rv   c                      e Zd ZdZdZdZdZdS )DataTypezEnum for dataset data types.kvllmchatN)r#   r$   r%   r&   r{   r|   r}   r(   r)   r*   rz   rz      s#        &&	B
CDDDr)   rz   c                  T    e Zd ZU dZded<   dZded<   dZded<    G d	 d
          ZdS )DatasetBasezDataset base model.r   nameNrV   descriptionzOptional[DataType]	data_typec                      e Zd ZdZdZdS )DatasetBase.Configr9   TNr:   r(   r)   r*   r<   r      r=   r)   r<   )r#   r$   r%   r&   r'   r   r   r<   r(   r)   r*   r   r      so         III!%K%%%%$(I((((         r)   r   c                  (    e Zd ZU dZded<   ded<    ed          Zded	<   dZd
ed<   dZd
ed<   dZ	ded<   dZ
ded<   dZded<    ed          Zded<    ed          Zded<    ed          Zded<   	 	 	 dd fdZedd            Z xZS )DatasetzDataset ORM model.r   rB   r   rJ   Nr2   rR   rS   Optional[int]example_countsession_countlast_session_start_timer4   inputs_schemaoutputs_schemarV   rW   rA   rX   _public_pathrY   r	   rZ   r[   c                    d|v r|                     d          |d<   d|v r|                     d          |d<    t                      j        di | || _        || _        || _        dS )r]   inputs_schema_definitionr   outputs_schema_definitionr   Nr(   )popr^   r_   rW   rX   r   )r`   rW   rX   r   rY   ra   s        r*   r_   zDataset.__init__   s     &//&,jj1K&L&LF?#&&00'-zz2M'N'NF#$""6""""$(r)   c                    | j         rU| j        r| j          | j         S | j        r&| j          dt          | j                   d| j         S | j          d| j         S dS )rc   re   rd   N)rW   r   rX   r   rB   rl   s    r*   rg   zDataset.url   s     > 	:  >.=$*;=== W.VVS-A-AVVTWVVVn99999tr)   )NNN)
rW   rV   rX   rA   r   rV   rY   r	   rZ   r[   rn   )r#   r$   r%   r&   r'   r   rS   r   r   r   r   r   r   rW   rX   r   r_   rp   rg   rq   rr   s   @r*   r   r      sX        HHH&+eD&9&9&9K9999#'M''''#'M''''266666.2M2222/3N3333*{4888I8888!,T!:!:!:J::::"-+d";";";L;;;; $(%)&*	) ) ) ) ) ) )&    X    r)   r   c                  ,    e Zd ZU dZdZded<   ded<   dS )DatasetVersionz%Class representing a dataset version.NOptional[List[str]]tagsr   as_of)r#   r$   r%   r&   r   r'   r(   r)   r*   r   r      s0         // $D$$$$OOOOOr)   r   c                 
    di iS )Nr6   r(   r(   r)   r*   _default_extrar      s    r)   c                  f   e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 d	Zd
ed<   	  ee          Zded<   	 d	Z	ded<   	 d	Z
ded<   	 d	Zded<   	  ee          Zded<   	 d	Zded<   	 d	Zded<   	 d	Zded<   	 d	Zded<   	  ee          Zded<   	 ed#d             Zed$d!            Zd" Zd	S )%RunBasea3  Base Run schema.

    A Run is a span representing a single unit of work or operation within your LLM app.
    This could be a single call to an LLM or chain, to a prompt formatting call,
    to a runnable lambda invocation. If you are familiar with OpenTelemetry,
    you can think of a run as a span.
    r   rB   r   r   r   
start_timerun_typeNrR   end_timer.   Optional[dict]extrarV   error
serializedzOptional[List[Dict]]eventsr>   r1   r5   rA   reference_example_idparent_run_idr   r   AttachmentsattachmentsrZ   dict[str, Any]c                T    | j         i | _         | j                             di           S zRetrieve the metadata (if any).Nr6   )r   
setdefaultrl   s    r*   r6   zRunBase.metadata   s+     :DJz$$Z444r)   c                6    | j                             d          S )z"Retrieve the revision ID (if any).revision_id)r6   getrl   s    r*   r   zRunBase.revision_id'  s     }  ///r)   c                F    | j          d| j         d| j         d| j         dS )ri   rj   z, name='z', run_type='rk   )ra   rB   r   r   rl   s    r*   rm   zRunBase.__repr__,  s1    .``dg``ty``t}````r)   rZ   r   )rZ   rA   )r#   r$   r%   r&   r'   r   r   r   r   r   r   r   r>   r1   r5   r   r   r   r   rp   r6   r   rm   r(   r)   r*   r   r      s          HHH(III* MMM" $(H''''-!E.AAAEAAAA=E;!%J%%%%F#'F'''' 5...F....""G""""/+/////@$(M((((@ $D$$$$6$uT:::K::::4 5 5 5 X5 0 0 0 X0a a a a ar)   r   c                      e Zd ZU dZdZded<   	 dZded<   	 dZded<   	 dZd	ed
<   	 dZ	ded<   	 dZ
ded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 ded<   	  ed          Zded<   	 dZd ed!<   	  ed          Zded"<   d)d* fd'Zed+d(            Z xZS ),Runz$Run schema when loading from the DB.NrA   
session_idOptional[List[UUID]]child_run_idszOptional[List[Run]]
child_runsr4   feedback_statsrV   app_pathmanifest_idstatusr   prompt_tokenscompletion_tokenstotal_tokensrR   first_token_timeOptional[Decimal]
total_costprompt_costcompletion_costparent_run_idsr   trace_id r2   r   dotted_orderOptional[bool]
in_datasetrW   rY   r	   rZ   r[   c                r   |                     d          sd|                     d          i|}|                    dd          pi } t                      j        di |d|i || _        | j                                        s0| j        s+| j        	                                 | j
         | _        dS dS dS )Initialize a Run object.r   rB   r1   Nr(   )r   r   r^   r_   rW   r   stripr   r   	isoformatrB   )r`   rW   rY   r1   ra   s       r*   r_   zRun.__init__f  s    zz*%% 	> &**T"2"2=f=FHd++1r11611&1111" &&(( 	J1C 	J#'?#<#<#>#> I I ID	J 	J 	J 	Jr)   c                B    | j         r| j        r| j          | j         S dS )rc   N)rW   r   rl   s    r*   rg   zRun.urlp  s1     > 	6dm 	6n5dm555tr)   rD   rW   rV   rY   r	   rZ   r[   rn   )r#   r$   r%   r&   r   r'   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rW   r_   rp   rg   rq   rr   s   @r*   r   r   1  s        ..!%J%%%%-*.M....(&*J****M/3N3333&"H""""7"&K&&&&: F    .#'M''''/'+++++/"&L&&&&1+/////-$(J((((M%)K))))G)-O----C+/N////!NNNCb)))L))))
 "&J%%%%+*{4888I8888J J J J J J J    X    r)   r   c                  .    e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
RunTypeEnumz5(Deprecated) Enum for run types. Use string directly.toolchainr|   	retriever	embeddingpromptparserN)r#   r$   r%   r&   r   r   r|   r   r   r   r   r(   r)   r*   r   r   x  s7        ??DE
CIIFFFFr)   r   c                     e Zd ZU dZded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   d ed!<   ded"<   d#ed$<   d%S )&RunLikeDictz&Run-like dictionary, for type-hinting.r   r   r   r   r   r   r   r1   r5   rR   r   r   rV   r   r   rA   r   r   Optional[List[dict]]r   r   r   inputs_s3_urlsoutputs_s3_urlsrB   r   session_namer   input_attachmentsoutput_attachmentsr   r   r   r   r   Nr"   r(   r)   r*   r   r     s2        00III    !!!!    """"####((((%%%%&&&&NNNr)   r   F)totalc                  2    e Zd ZU dZdZded<   	 dZded<   dS )RunWithAnnotationQueueInfoz&Run schema with annotation queue info.NrR   last_reviewed_timeadded_at)r#   r$   r%   r&   r   r'   r   r(   r)   r*   r   r     s>         00-11111.#'H''''33r)   r   c                  B    e Zd ZU dZded<   	  ee          Zded<   dS )FeedbackSourceBasezBase class for feedback sources.

    This represents whether feedback is submitted from the API, model, human labeler,
        etc.
    r   typer.   r4   r6   N)r#   r$   r%   r&   r'   r   r>   r6   r(   r)   r*   r   r     sH           III*).t)D)D)DHDDDD66r)   r   c                  "    e Zd ZU dZdZded<   dS )APIFeedbackSourcezAPI feedback source.apizLiteral['api']r   Nr#   r$   r%   r&   r   r'   r(   r)   r*   r   r     s)          D      r)   r   c                  "    e Zd ZU dZdZded<   dS )ModelFeedbackSourcezModel feedback source.modelzLiteral['model']r   Nr   r(   r)   r*   r   r     s)           $D$$$$$$r)   r   c                      e Zd ZdZdZ	 dZdS )FeedbackSourceTypezFeedback source type.r   r   N)r#   r$   r%   r&   APIMODELr(   r)   r*   r   r     s#        
C2E""r)   r   c                     e Zd ZU dZded<   	 dZded<   	 dZded<   	 ded	<   	 ded
<   	 ded<   	 dZded<   	 dZded<   	 dZ	ded<   	 dZ
ded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	 dZded<   	  G d d          ZdS )FeedbackBasezFeedback schema.r   rB   NrR   rJ   rS   rA   run_idr   r   key
SCORE_TYPEscore
VALUE_TYPEvaluerV   commentzUnion[str, dict, None]
correctionOptional[FeedbackSourceBase]feedback_sourcer   comparative_experiment_idfeedback_group_idzOptional[Dict]r   c                      e Zd ZdZdZdS )FeedbackBase.Configr9   TNr:   r(   r)   r*   r<   r    r=   r)   r<   )r#   r$   r%   r&   r'   rJ   rS   r   r   r   r   r   r   r   r   r   r<   r(   r)   r*   r   r     s\        HHH(%)J)))),&*K****2<>HHHAE+EQ!G!!!!2)-J----!48O8888%!%J%%%%T044444X(,,,,,1 !E    '         r)   r   c                  *    e Zd ZU dZded<   	 ded<   dS )FeedbackCategoryz+Specific value and label pair for feedback.floatr   rV   labelNr"   r(   r)   r*   r  r    s0         55LLLCNNr)   r  c                  B    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   d	S )
FeedbackConfigz:Represents _how_ a feedback value ought to be interpreted.z0Literal['continuous', 'categorical', 'freeform']r   Optional[float]minmaxz Optional[List[FeedbackCategory]]
categoriesNr"   r(   r)   r*   r  r    sW         DD::::440000@ @r)   r  c                  .    e Zd ZU dZded<   	 dZded<   dS )FeedbackCreatez"Schema used for creating feedback.r   r   NzOptional[FeedbackConfig]feedback_config)r#   r$   r%   r&   r'   r  r(   r)   r*   r  r    s8         ,,''''%04O444444r)   r  c                  D    e Zd ZU dZded<   ded<   	 ded<   	 dZded	<   dS )
FeedbackzSchema for getting feedback.r   rB   r   rJ   rS   Nr   r   )r#   r$   r%   r&   r'   r   r(   r)   r*   r  r    sP         &&HHH,248O888822r)   r  c                      e Zd ZU dZded<   	  ed           Zded<   	 dZd	ed
<   	 dZded<   	 dZ	ded<   	 dZ
ded<   	 ded<   	 ded<   	  ed          Zded<   dd  fdZed!d            Zed"d            Zed#d            Z xZS )$TracerSessionzbTracerSession schema for the API.

    Sessions are also referred to as "Projects" in the UI.
    r   rB   c                 >    t          j        t          j                  S rD   rE   r(   r)   r*   rH   zTracerSession.<lambda>)  rI   r)   r.   r   r   NrR   r   rV   r   r   r4   r   	tenant_idrA   reference_dataset_idr2   rW   rY   r	   rZ   r[   c                     t                      j        di | || _        | j        j        ,| j                            t          j                  | _        dS dS )r   N)tzinfor(   )r^   r_   rW   r   r  replacer   rG   )r`   rW   rY   ra   s      r*   r_   zTracerSession.__init__:  sZ    ""6""""?!)"o55X\5JJDOOO *)r)   c                F    | j         r| j          d| j         d| j         S dS )rc   re   z/projects/p/N)rW   r  rB   rl   s    r*   rg   zTracerSession.urlA  s6     > 	OnNNNNTWNNNtr)   r   c                @    | j         	d| j         vri S | j         d         S r   r   rl   s    r*   r6   zTracerSession.metadataH  *     :4:!=!=Iz*%%r)   	List[str]c                @    | j         	d| j         vrg S | j         d         S )zRetrieve the tags (if any).Nr   r  rl   s    r*   r   zTracerSession.tagsO  s*     :tz!9!9Iz&!!r)   rD   r   rn   r   )rZ   r  )r#   r$   r%   r&   r'   r   r   r   r   r   r   r   rW   r_   rp   rg   r6   r   rq   rr   s   @r*   r  r  !  sq         
 HHH  51S1STTTJTTTT+#'H'''')!%K%%%%)D"&*E****)OOO0((((J*{4888I8888K K K K K K K    X & & & X& " " " X" " " " "r)   r  c                      e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded	<   	 d
ed<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   dS )TracerSessionResultzqA project, hydrated with additional information.

    Sessions are also referred to as "Projects" in the UI.
    r   	run_countzOptional[timedelta]latency_p50latency_p99r   r   r   rR   last_run_start_timer4   r   zOptional[List[Dict[str, Any]]]
run_facetsr   r   r   r   first_token_p50first_token_p99r  
error_rateNr"   r(   r)   r*   r   r   W  s          
 ,$$$$?$$$$6=    D$$$$H++++8,,,,)....-!!!!M""""G&&&&C((((G((((>))r)   r   c                  D    e Zd ZU dZded<   	 ded<   	 ed	d            ZdS )
BaseMessageLikez7A protocol representing objects similar to BaseMessage.r   contentzDict[Any, Any]additional_kwargsrZ   c                    dS )z,Type of the Message, used for serialization.Nr(   rl   s    r*   r   zBaseMessageLike.type  s      r)   N)rZ   r   )r#   r$   r%   r&   r'   rp   r   r(   r)   r*   r*  r*  }  sU         AALLL%%%%%C; ; ; X; ; ;r)   r*  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )DatasetShareSchemaz*Represents the schema for a dataset share.r   r-   share_tokenr   rg   Nr"   r(   r)   r*   r/  r/    s?         44 ,HHH((r)   r/  c                      e Zd ZU dZded<   	 ded<   	 dZded<   	  ed	 
          Zded<   	  ed 
          Zded<   	 ded<   dS )AnnotationQueuezRepresents an annotation queue.r   rB   r   r   NrV   r   c                 >    t          j        t          j                  S rD   rE   r(   r)   r*   rH   zAnnotationQueue.<lambda>  rI   r)   r.   r   rJ   c                 >    t          j        t          j                  S rD   rE   r(   r)   r*   rH   zAnnotationQueue.<lambda>  rI   r)   
updated_atr  )	r#   r$   r%   r&   r'   r   r   rJ   r5  r(   r)   r*   r2  r2    s         ))HHH8III+!%K%%%%: 51S1STTTJTTTT> 51S1STTTJTTTTCOOODDr)   r2  c                  Z    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded<   	 d	ed
<   dS )BatchIngestConfigz"Configuration for batch ingestion.booluse_multipart_endpointintscale_up_qsize_triggerscale_up_nthreads_limitscale_down_nempty_trigger
size_limitr   size_limit_bytesNr"   r(   r)   r*   r7  r7    sl         ,,    D<    7""""AOOO/####88r)   r7  c                  B    e Zd ZU dZdZded<   	 dZded<   	 dZded	<   dS )
LangSmithInfoz'Information about the LangSmith server.r   r   versionNrR   license_expiration_timezOptional[BatchIngestConfig]batch_ingest_config)r#   r$   r%   r&   rB  r'   rC  rD  r(   r)   r*   rA  rA    sS         11G.266666+7;;;;;;;r)   rA  c                  F    e Zd ZU dZded<   	 ded<   	 ded<   	 dZded	<   dS )
LangSmithSettingsz"Settings for the LangSmith tenant.r   rB   display_namer   rJ   NrV   tenant_handle)r#   r$   r%   r&   r'   rH  r(   r)   r*   rF  rF    sS         ,,GGG)*#'M''''''r)   rF  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )	FeedbackIngestTokenz2Represents the schema for a feedback ingest token.r   rB   r   rg   r   
expires_atNr"   r(   r)   r*   rJ  rJ    s<         <<HHH.HHH3++r)   rJ  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )	RunEventzRun event schema.r   r   zUnion[datetime, str]timer4   rY   Nr"   r(   r)   r*   rM  rM    s?         III$$$$,,r)   rM  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )TimeDeltaInputzTimedelta input schema.r:  dayshoursminutesNr"   r(   r)   r*   rP  rP    s9         !!IIIJJJLLLr)   rP  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )DatasetDiffInfoz;Represents the difference information between two datasets.z
List[UUID]examples_modifiedexamples_addedexamples_removedNr"   r(   r)   r*   rU  rU    sB         EE!!!!=:    <<r)   rU  c                      e Zd ZU dZded<   	 dZded<   	 dZded<   	 ded<   	 d	ed
<   	 d	ed<   	 ded<   	 dZded<   	 dZded<   	 dZ	ded<   	 e
dd            ZdS )ComparativeExperimentzRepresents a comparative experiment.

    This information summarizes evaluation results comparing
    two or more models on a given dataset.
    r   rB   NrV   r   r   r  r   rJ   rS   r  r4   r   r   experiments_infor   rZ   r   c                @    | j         	d| j         vri S | j         d         S r   r  rl   s    r*   r6   zComparativeExperiment.metadata  r  r)   r   )r#   r$   r%   r&   r'   r   r   r   r[  r   rp   r6   r(   r)   r*   rZ  rZ    s           HHH?D:!%K%%%%@OOOGDJJ&*E****?-11111\/3N3333P& & & X& & &r)   rZ  c                  N    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded	<   d
S )PromptCommitz$Represents a Prompt with a manifest.r   ownerrepocommit_hashr0   manifestz
List[dict]examplesNr"   r(   r)   r*   r^  r^  !  sZ         ..JJJ0III!(%r)   r^  c                      e Zd ZU dZded<   	 ded<   	 ded<   	 dZded	<   	 dZded
<   	 dZded<   	 dZded<   	 dZ	ded<   	 dZ
ded<   	  ee          Zded<   	 dZded<   	 dZded<   	 dZded<   dS )ListedPromptCommitz;Represents a listed prompt commit with associated metadata.r   rB   r   r_  r`  NrA   r   repo_id	parent_idrV   ra  rR   rJ   r5  r.   r   example_run_idsr   r   num_downloads	num_viewsparent_commit_hash)r#   r$   r%   r&   r'   r   rf  rg  ra  rJ   r5  r   ro   rh  ri  rj  rk  r(   r)   r*   re  re  0  s        EEHHH6JJJ)III3"&K&&&&O"G""""5 $I$$$$8!%K%%%%*%)J))))=%)J))))B,1E$,G,G,GOGGGGH#$M$$$$> I    :(,,,,,11r)   re  c                  :   e Zd ZU dZded<   	 dZded<   	 dZded<   	 ded<   	 ded	<   	 d
ed<   	 d
ed<   	 ded<   	 ded<   	 ded<   	 dZded<   	 dZded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 dZ	ded<   	 dZ
ded<   	 ded<   	 dZded<   	 dZded<   dS ) Promptz"Represents a Prompt with metadata.r   repo_handleNrV   r   readmerB   r  r   rJ   r5  r8  	is_publicis_archivedr  r   original_repo_idupstream_repo_idr_  	full_namer:  	num_likesri  rj  r   liked_by_auth_userlast_commit_hashnum_commitsoriginal_repo_full_nameupstream_repo_full_name)r#   r$   r%   r&   r'   r   ro  rr  rs  rv  rw  ry  rz  r(   r)   r*   rm  rm  [  sx        ,,!!%K%%%%( F    #GGGNNN,*-OOO')OOO.&*****3&*****30NNN<NNN"NNN)-----@&*****& -11111:-11111::r)   rm  c                  *    e Zd ZU dZded<   	 ded<   dS )ListPromptsResponsez A list of prompts with metadata.zList[Prompt]reposr:  r   Nr"   r(   r)   r*   r|  r|    s0         **JJJ&&r)   r|  c                  (    e Zd ZdZdZ	 dZ	 dZ	 dZdS )PromptSortFieldz$Enum for sorting fields for prompts.ri  rj  r5  ru  N)r#   r$   r%   r&   ri  rj  r5  ru  r(   r)   r*   r  r    s3        ..#MIJIr)   r  c                  6    e Zd ZU dZded<   	 ded<   	 ded<   dS )InputTokenDetailsz~Breakdown of input token counts.

    Does *not* need to sum to full input token count. Does *not* need to have all keys.
    r:  audiocache_creation
cache_readNr"   r(   r)   r*   r  r    sJ          
 JJJ OOO r)   r  c                  *    e Zd ZU dZded<   	 ded<   dS )OutputTokenDetailszBreakdown of output token counts.

    Does *not* need to sum to full output token count. Does *not* need to have all keys.
    r:  r  	reasoningNr"   r(   r)   r*   r  r    s7          
 JJJNNN r)   r  c                  N    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded	<   d
S )UsageMetadatazUsage metadata for a message, such as token counts.

    This is a standard representation of token usage that is consistent across models.
    r:  input_tokensoutput_tokensr   zNotRequired[InputTokenDetails]input_token_detailszNotRequired[OutputTokenDetails]output_token_detailsNr"   r(   r)   r*   r  r    sn          
 JPA7777 :999 r)   r  )Wr&   
__future__r   r   r   r   decimalr   enumr   typingr	   r
   r   r   r   r   r   r   r   uuidr   typing_extensionsr   r   pydantic.v1r   r   r   r   r   r   ImportErrorpydanticr   r   r   r   r   r    r   r,   r@   rN   rt   rv   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r   r*  r/  r2  r7  rA  update_forward_refsrF  rJ  rM  rP  rU  rZ  r^  re  rm  r|  r  r  r  r  r(   r)   r*   <module>r     sO
   $ $ " " " " " " 2 2 2 2 2 2 2 2 2 2            
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
       4 4 4 4 4 4 4 4                                      & % % % % %:y+t;<
4d?#
       $ 3eCJ/;<<= W    )   2 2 2 2 2K 2 2 2%b %b %b %b %bk %b %b %bP    K       I       sD   
 
 
 
 
) 
 
 
+ + + + +k + + +\    Y     Ga Ga Ga Ga Gai Ga Ga GaTD D D D D' D D DN	 	 	 	 	#t 	 	 	    )5    :4 4 4 4 4 4 4 4
7 
7 
7 
7 
7 
7 
7 
7! ! ! ! !* ! ! !% % % % %, % % %# # # # # # # #' ' ' ' '9 ' ' 'TO O O O Oy O O O O@ @ @ @ @Ye @ @ @ @5 5 5 5 5\ 5 5 5	3 	3 	3 	3 	3| 	3 	3 	33" 3" 3" 3" 3"I 3" 3" 3"l#* #* #* #* #*- #* #* #*L 
; 
; 
; 
; 
;h 
; 
; 
;) ) ) ) )% ) ) ) )E E E E Ei E E E"9 9 9 9 9	 9 9 9 9"< < < < <I < < <      	( 	( 	( 	( 	(	 	( 	( 	(, , , , ,) , , ,- - - - -y - - - -    Ye    = = = = =i = = =!& !& !& !& !&I !& !& !&H         9      (2 (2 (2 (2 (2 (2 (2 (2V.; .; .; .; .;Y .; .; .;b' ' ' ' ') ' ' '
 
 
 
 
c4 
 
 
    	    *    %         I     s   A A-,A-