o
    ,ig                     @  s  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 zdd	lmZmZmZmZmZmZ W n e ym   dd	l!mZmZmZmZmZmZ Y nw dd
l"m#Z# ddlm$Z$ eeeedf Z%eee&df Z'G dd deZ(ee&eee&e)f e(ee&e#f f f Z*	 eG dd deZ+G dd deZ,G dd deZ-ee(e-ee&e)f ee&e#f f Z.G dd deZ/e/Z0G dd de/Z1G dd deZ2G dd de,Z3G dd de,Z4G dd  d eZ5G d!d" d"eZ6e6Z7G d#d$ d$e&e	Z8G d%d& d&eZ9e$d' Z:G d(d) d)ed*d+Z;G d,d- d-e9Z<G d.d/ d/eZ=d0d1 Z>G d2d3 d3eZ?G d4d5 d5e?Z@G d6d7 d7e&e	ZAG d8d9 d9ed*d+ZBG d:d; d;e?ZCG d<d= d=eZDG d>d? d?eDZEG d@dA dAeDZFG dBdC dCe	ZGG dDdE dEeZHG dFdG dGed*d+ZIG dHdI dIed*d+ZJG dJdK dKeHZKG dLdM dMeHZLG dNdO dOeZMG dPdQ dQeMZNeG dRdS dSeZOG dTdU dUed*d+ZPG dVdW dWeZQG dXdY dYed*d+ZRG dZd[ d[eZSe3T  G d\d] d]eZUG d^d_ d_eZVG d`da daed*d+ZWG dbdc dced*d+ZXG ddde deeZYG dfdg dgeZZG dhdi dieZ[G djdk dkeZ\G dldm dmeZ]G dndo doeZ^G dpdq dqe&e	Z_G drds dsed*d+Z`G dtdu dued*d+ZaG dvdw dweZbG dxdy dyeZcdS )zz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)Path)LiteralNc                   @  "   e Zd ZU dZded< ded< dS )
Attachmenta  Annotated type that will be stored as an attachment if used.

    Examples:

        .. code-block:: python

            from langsmith import traceable
            from langsmith.schemas import Attachment


            @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Union[bytes, Path]dataN__name__
__module____qualname____doc____annotations__ r(   r(   k/var/www/eduai.edurigo.com/doc_train/edurigo_ai/Puru/venv/lib/python3.10/site-packages/langsmith/schemas.pyr   2   s   
 r   c                   @  s2   e Zd ZdZddddZddddZdddZdS )BinaryIOLikez$Protocol for binary IO-like objects.sizeintreturnbytesc                 C     dS )zRead function.Nr(   )selfr,   r(   r(   r)   readQ      zBinaryIOLike.readr   offsetwhencec                 C  r0   )zSeek function.Nr(   )r1   r4   r5   r(   r(   r)   seekU   r3   zBinaryIOLike.seekc                 C  r0   )zGet value function.Nr(   r1   r(   r(   r)   getvalueY   r3   zBinaryIOLike.getvalueN)r+   )r,   r-   r.   r/   )r   )r4   r-   r5   r-   r.   r-   )r.   r/   )r#   r$   r%   r&   r2   r6   r8   r(   r(   r(   r)   r*   M   s
    r*   c                   @  s^   e Zd ZU dZded< eddZded< eddZded< eddZded	< G d
d dZ	dS )ExampleBasezExample base model.r   
dataset_idNdefaultOptional[Dict[str, Any]]inputsoutputsmetadatac                   @  s   e Zd ZdZdZdZdS )zExampleBase.Config#Configuration class for the schema.TN)r#   r$   r%   r&   frozenarbitrary_types_allowedr(   r(   r(   r)   Configf   s    rD   )
r#   r$   r%   r&   r'   r   r>   r?   r@   rD   r(   r(   r(   r)   r9   ^   s   
 r9   c                   @  s   e Zd ZU ded< ded< dS )_AttachmentDictr   r   r    r!   N)r#   r$   r%   r'   r(   r(   r(   r)   rE   m   s   
 rE   c                      s   e Zd ZU dZded< edd dZded< ed	d
Zded< ed	d
Zde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<  fddZ  ZS )ExampleCreatez Example upload with attachments.Optional[UUID]idc                   C     t tjS Nr   nowr   utcr(   r(   r(   r)   <lambda>{       zExampleCreate.<lambda>default_factoryr   
created_atNr;   r=   r>   r?   r@   Optional[Union[str, List[str]]]splitz$Optional[dict[str, _AttachmentLike]]attachmentsFbooluse_source_run_ioOptional[List[str]]use_source_run_attachmentssource_run_idc                      t  jdi | dS zInitialize from dict.Nr(   super__init__r1   r!   	__class__r(   r)   r_         zExampleCreate.__init__)r#   r$   r%   r&   r'   r   rR   r>   r?   r@   rT   rU   rW   rY   rZ   r_   __classcell__r(   r(   ra   r)   rF   w   s   
 rF   c                   @     e Zd ZU dZded< dS )ExampleUpsertWithAttachmentsz Example create with attachments.r   r:   Nr"   r(   r(   r(   r)   rf         
 rf   c                   @  s*   e Zd ZU dZded< ded< ded< dS )	AttachmentInfozInfo for an attachment.r   presigned_urlr*   readerOptional[str]r   Nr"   r(   r(   r(   r)   rh      s
   
 rh   c                      s   e Zd ZU dZded< edd dZded< eed	d
Zded< edd
Z	ded< ee
dZded< dZded< edd
Zded< 	 edd
Zded< edd
Zded< 		d"d# fddZed$ddZd d! Z  ZS )%ExamplezExample model.r   rH   c                   C  s   t jdtjdS )Nr   )tz)r   fromtimestampr   rM   r(   r(   r(   r)   rN      s    zExample.<lambda>rP   r   rR   z$00000000-0000-0000-0000-000000000000r;   r:   NOptional[datetime]modified_atz	List[Run]runsrG   rZ   z#Optional[Dict[str, AttachmentInfo]]rU   rk   	_host_url
_tenant_idkwargsr   r.   Nonec                   s"   t  jdi | || _|| _dS )Initialize a Dataset object.Nr(   )r^   r_   rr   rs   )r1   rr   rs   rt   ra   r(   r)   r_      s   
zExample.__init__c                 C  sL   | j r$d| 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)rr   r:   rH   rs   r   )r1   pathr(   r(   r)   url   s   zExample.urlc                 C  $   | j  d| j d| j d| j dS )5Return a string representation of the RunBase object.(id=z, dataset_id=z, link=''))rb   rH   r:   r{   r7   r(   r(   r)   __repr__      $zExample.__repr__)NN)rr   rk   rs   rG   rt   r   r.   ru   r.   rk   )r#   r$   r%   r&   r'   r   rR   r   r:   rp   listrq   rZ   rU   r   rr   rs   r_   propertyr{   r   rd   r(   r(   ra   r)   rl      s(   
 	rl   c                   @  re   )ExampleSearchzExample returned via search.r   rH   Nr"   r(   r(   r(   r)   r      rg   r   c                   @  s:   e Zd ZU dZeeddZded< eeddZ	ded< d	S )
AttachmentsOperationsz%Operations to perform on attachments.z,Mapping of old attachment names to new names)rQ   descriptionzDict[str, str]renamez List of attachment names to keep	List[str]retainN)
r#   r$   r%   r&   r   dictr   r'   r   r   r(   r(   r(   r)   r      s   
 r   c                      s   e Zd ZU dZded< dZded< eddZded	< eddZde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 dZ fddZ  ZS )ExampleUpdatez Example update with attachments.r   rH   NrG   r:   r;   r=   r>   r?   r@   rS   rT   zOptional[Attachments]rU   zOptional[AttachmentsOperations]attachments_operationsc                   @     e Zd ZdZdZdS )zExampleUpdate.ConfigrA   TNr#   r$   r%   r&   rB   r(   r(   r(   r)   rD          rD   c                   r[   r\   r]   r`   ra   r(   r)   r_      rc   zExampleUpdate.__init__)r#   r$   r%   r&   r'   r:   r   r>   r?   r@   rT   rU   r   rD   r_   rd   r(   r(   ra   r)   r      s   
 r   c                   @  s   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(   r)   r      s
    r   c                   @  s@   e Zd ZU dZded< dZded< dZded< G d	d
 d
ZdS )DatasetBasezDataset base model.r   nameNrk   r   zOptional[DataType]	data_typec                   @  r   )zDatasetBase.ConfigrA   TNr   r(   r(   r(   r)   rD      r   rD   )r#   r$   r%   r&   r'   r   r   rD   r(   r(   r(   r)   r      s   
 r   )remove_system_messagesconvert_to_openai_messageconvert_to_openai_toolremove_extra_fieldsextract_tools_from_runc                   @  r   )DatasetTransformationz#Schema for dataset transformations.r   rz   z%Union[DatasetTransformationType, str]transformation_typeNr"   r(   r(   r(   r)   r     s   
 r   F)totalc                      s   e Zd ZU dZded< de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< eddZded< eddZded< eddZded< 			d d! fddZed"ddZ  ZS )#DatasetzDataset ORM model.r   rH   r   rR   Nr;   ro   rp   Optional[int]example_countsession_countlast_session_start_timer=   inputs_schemaoutputs_schemaz%Optional[List[DatasetTransformation]]transformationsrk   rr   rG   rs   _public_pathrt   r   r.   ru   c                   sT   d|v r| d|d< d|v r| d|d< t jdi | || _|| _|| _dS )rv   inputs_schema_definitionr   outputs_schema_definitionr   Nr(   )popr^   r_   rr   rs   r   )r1   rr   rs   r   rt   ra   r(   r)   r_   %  s   
zDataset.__init__c                 C  sV   | j r)| jr| j  | j S | jr | j  dt| j d| j S | j  d| j S dS )rw   ry   rx   N)rr   r   rs   r   rH   r7   r(   r(   r)   r{   8  s   zDataset.url)NNN)
rr   rk   rs   rG   r   rk   rt   r   r.   ru   r   )r#   r$   r%   r&   r'   r   rp   r   r   r   r   r   r   r   rr   rs   r   r_   r   r{   rd   r(   r(   ra   r)   r     s(   
 r   c                   @  s&   e Zd ZU dZdZded< ded< dS )DatasetVersionz%Class representing a dataset version.NrX   tagsr   as_of)r#   r$   r%   r&   r   r'   r(   r(   r(   r)   r   D  s   
 r   c                   C  s   di iS )Nr@   r(   r(   r(   r(   r)   _default_extraK  s   r   c                   @  s  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dZded< 	 d	Z	ded< 	 d	Z
ded< 	 d	Zded< 	 e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< 	 eedZded< 	 ed(d d!Zed)d"d#Zd$d% ZG d&d' 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   rH   r   r   r   
start_timerun_typeNro   end_timerP   Optional[dict]extrark   error
serializedzOptional[List[Dict]]eventsr   r>   r?   rG   reference_example_idparent_run_idrX   r   z-Union[Attachments, Dict[str, AttachmentInfo]]rU   r.   dict[str, Any]c                 C  s   | j du ri | _ | j di S zRetrieve the metadata (if any).Nr@   )r   
setdefaultr7   r(   r(   r)   r@     s   
zRunBase.metadatac                 C  s   | j dS )z"Retrieve the revision ID (if any).revision_id)r@   getr7   r(   r(   r)   r     s   zRunBase.revision_idc                 C  r|   )r}   r~   z, name='z', run_type='r   )rb   rH   r   r   r7   r(   r(   r)   r     r   zRunBase.__repr__c                   @  r   )zRunBase.ConfigrA   TN)r#   r$   r%   r&   rC   r(   r(   r(   r)   rD     r   rD   r.   r   )r.   rG   )r#   r$   r%   r&   r'   r   r   r   r   r   r   r   r   r>   r?   r   r   r   rU   r   r@   r   r   rD   r(   r(   r(   r)   r   O  sP   
 r   c                      sD  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dZded< 	 dZd ed!< 	 eddZded"< d+d, fd'd(Zed-d)d*Z  ZS ).Runz$Run schema when loading from the DB.NrG   
session_idOptional[List[UUID]]child_run_idszOptional[List[Run]]
child_runsr=   feedback_statsrk   app_pathmanifest_idstatusr   prompt_tokenscompletion_tokenstotal_tokensro   first_token_timeOptional[Decimal]
total_costprompt_costcompletion_costparent_run_idsr   trace_id r;   r   dotted_orderOptional[bool]
in_datasetrr   rt   r   r.   ru   c                   s~   | dsd| di|}|ddpi }t jdi |d|i || _| j s;| js=| j	  | j
 | _dS dS dS )Initialize a Run object.r   rH   r>   Nr(   )r   r   r^   r_   rr   r   stripr   r   	isoformatrH   )r1   rr   rt   r>   ra   r(   r)   r_     s   
zRun.__init__c                 C  s    | j r| jr| j  | j S dS )rw   N)rr   r   r7   r(   r(   r)   r{     s   zRun.urlrJ   rr   rk   rt   r   r.   ru   r   )r#   r$   r%   r&   r   r'   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rr   r_   r   r{   rd   r(   r(   ra   r)   r     sT   
 
r   c                   @  s,   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     s    r   c                   @  s   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   r>   r?   ro   r   r   rk   r   r   rG   r   r   Optional[List[dict]]r   rX   r   inputs_s3_urlsoutputs_s3_urlsrH   r   session_namer   input_attachmentsoutput_attachmentsr   r   r   AttachmentsrU   Nr"   r(   r(   r(   r)   r     s4   
 r   c                   @  s,   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.Nro   last_reviewed_timeadded_at)r#   r$   r%   r&   r   r'   r   r(   r(   r(   r)   r     s   
 r   c                   @  sJ   e Zd ZU dZded< 	 eedZded< 	 dZded	< 	 d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   typerP   r=   r@   NzOptional[Union[UUID, str]]user_idrk   	user_name)
r#   r$   r%   r&   r'   r   r   r@   r   r   r(   r(   r(   r)   r     s   
 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   *     
 r   c                   @  r   )ModelFeedbackSourcezModel feedback source.modelzLiteral['model']r   Nr   r(   r(   r(   r)   r   0  r   r   c                   @  s   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   6  s    r   c                   @  s   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 dZdS )FeedbackBasezFeedback schema.r   rH   Nro   rR   rp   rG   run_idr   r   key
SCORE_TYPEscore
VALUE_TYPEvaluerk   commentzUnion[str, dict, None]
correctionOptional[FeedbackSourceBase]feedback_sourcer   comparative_experiment_idfeedback_group_idzOptional[Dict]r   c                   @  r   )zFeedbackBase.ConfigrA   TNr   r(   r(   r(   r)   rD   c  r   rD   )r#   r$   r%   r&   r'   rR   rp   r   r  r  r  r  r   r  r  r   rD   r(   r(   r(   r)   r   ?  sB   
 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  rk   labelNr"   r(   r(   r(   r)   r
  i     
 r
  c                   @  s8   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  r  s   
 r  c                   @  s6   e Zd ZU dZded< 	 dZded< 	 dZded< dS )	FeedbackCreatez"Schema used for creating feedback.r   r  NzOptional[FeedbackConfig]feedback_configr   r   )r#   r$   r%   r&   r'   r  r   r(   r(   r(   r)   r    s   
 r  c                   @  s:   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   rH   r   rR   rp   Nr  r  )r#   r$   r%   r&   r'   r  r(   r(   r(   r)   r    s   
 r  c                      s   e Zd ZU dZded< 	 ed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< 	 ded< 	 ed	dZded< d$d% fddZed&ddZed'dd Zed(d"d#Z  ZS ))TracerSessionzbTracerSession schema for the API.

    Sessions are also referred to as "Projects" in the UI.
    r   rH   c                   C  rI   rJ   rK   r(   r(   r(   r)   rN     rO   zTracerSession.<lambda>rP   r   r   Nro   r   rk   r   r   r=   r   	tenant_idrG   reference_dataset_idr;   rr   rt   r   r.   ru   c                   s>   t  jdi | || _| jjdu r| jjtjd| _dS dS )r   N)tzinfor(   )r^   r_   rr   r   r  replacer   rM   )r1   rr   rt   ra   r(   r)   r_     s
   zTracerSession.__init__c                 C  s$   | j r| j  d| j d| j S dS )rw   ry   z/projects/p/N)rr   r  rH   r7   r(   r(   r)   r{     s   zTracerSession.urlr   c                 C  "   | j du s
d| j vri S | j d S r   r   r7   r(   r(   r)   r@        
zTracerSession.metadatar   c                 C  s"   | j du s
d| j vrg S | j d S )zRetrieve the tags (if any).Nr   r  r7   r(   r(   r)   r     r  zTracerSession.tagsrJ   r   r   r   )r.   r   )r#   r$   r%   r&   r'   r   r   r   r   r   r   r   rr   r_   r   r{   r@   r   rd   r(   r(   ra   r)   r    s4   
 r  c                   @  s   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   ro   last_run_start_timer=   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    s@   
 r  c                   @  s4   e Zd ZU dZded< 	 ded< 	 ed
ddZd	S )BaseMessageLikez7A protocol representing objects similar to BaseMessage.r   contentzDict[Any, Any]additional_kwargsr.   c                 C  r0   )z,Type of the Message, used for serialization.Nr(   r7   r(   r(   r)   r     s    zBaseMessageLike.typeN)r.   r   )r#   r$   r%   r&   r'   r   r   r(   r(   r(   r)   r'    s   
 r'  c                   @  s.   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   r{   Nr"   r(   r(   r(   r)   r*        
 r*  c                   @  sl   e Zd ZU dZded< 	 ded< 	 dZded< 	 ed	d
 dZded< 	 edd
 dZded< 	 ded< dS )AnnotationQueuezRepresents an annotation queue.r   rH   r   r   Nrk   r   c                   C  rI   rJ   rK   r(   r(   r(   r)   rN     rO   zAnnotationQueue.<lambda>rP   r   rR   c                   C  rI   rJ   rK   r(   r(   r(   r)   rN     rO   
updated_atr  )	r#   r$   r%   r&   r'   r   r   rR   r.  r(   r(   r(   r)   r-    s   
 r-  c                   @  sL   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.rV   use_multipart_endpointr-   scale_up_qsize_triggerscale_up_nthreads_limitscale_down_nempty_trigger
size_limitr   size_limit_bytesNr"   r(   r(   r(   r)   r/    s   
 r/  c                   @  sH   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S )LangSmithInfoz'Information about the LangSmith server.r   r   versionNro   license_expiration_timezOptional[BatchIngestConfig]batch_ingest_configr=   instance_flags)	r#   r$   r%   r&   r7  r'   r8  r9  r:  r(   r(   r(   r)   r6  -  s   
 r6  c                   @  s<   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   rH   display_namer   rR   Nrk   tenant_handle)r#   r$   r%   r&   r'   r=  r(   r(   r(   r)   r;  <  s   
 r;  c                   @  .   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   rH   r   r{   r   
expires_atNr"   r(   r(   r(   r)   r?  H  r,  r?  c                   @  r>  )	RunEventzRun event schema.r   r   zUnion[datetime, str]timer=   rt   Nr"   r(   r(   r(   r)   rA  S  r,  rA  c                   @  .   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(   r)   rD  ^  r,  rD  c                   @  rC  )DatasetDiffInfoz;Represents the difference information between two datasets.z
List[UUID]examples_modifiedexamples_addedexamples_removedNr"   r(   r(   r(   r)   rH  i  r,  rH  c                   @  s   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dZdS )ComparativeExperimentzRepresents a comparative experiment.

    This information summarizes evaluation results comparing
    two or more models on a given dataset.
    r   rH   Nrk   r   r   r  r   rR   rp   r  r=   r   r   experiments_infor   r.   r   c                 C  r  r   r  r7   r(   r(   r)   r@     r  zComparativeExperiment.metadatar   )r#   r$   r%   r&   r'   r   r   r   rM  r   r   r@   r(   r(   r(   r)   rL  t  s0   
 rL  c                   @  B   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_hashzDict[str, Any]manifestz
List[dict]examplesNr"   r(   r(   r(   r)   rO    s   
 rO  c                   @  s   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d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   rH   r   rP  rQ  NrG   r   repo_id	parent_idrk   rR  ro   rR   r.  rP   r   example_run_idsr   r   num_downloads	num_viewsparent_commit_hash)r#   r$   r%   r&   r'   r   rV  rW  rR  rR   r.  r   r   rX  rY  rZ  r[  r(   r(   r(   r)   rU    s8   
 rU  c                   @  s  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_handleNrk   r   readmerH   r  r   rR   r.  rV   	is_publicis_archivedr   r   original_repo_idupstream_repo_idrP  	full_namer-   	num_likesrY  rZ  r   liked_by_auth_userlast_commit_hashnum_commitsoriginal_repo_full_nameupstream_repo_full_name)r#   r$   r%   r&   r'   r   r^  ra  rb  re  rf  rh  ri  r(   r(   r(   r)   r\    s\   
 r\  c                   @  r	  )ListPromptsResponsez A list of prompts with metadata.zList[Prompt]reposr-   r   Nr"   r(   r(   r(   r)   rj    r  rj  c                   @  s&   e Zd ZdZdZ	 dZ	 dZ	 dZdS )PromptSortFieldz$Enum for sorting fields for prompts.rY  rZ  r.  rd  N)r#   r$   r%   r&   rY  rZ  r.  rd  r(   r(   r(   r)   rl    s    rl  c                   @  rC  )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)   rm    s   
 rm  c                   @  s$   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-   rn  	reasoningNr"   r(   r(   r(   r)   rq  .  s   
 rq  c                   @  rN  )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)   rs  >  s   
 rs  c                   @  r	  )UpsertExamplesResponsezCResponse object returned from the upsert_examples_multipart method.r-   countr   example_idsNr"   r(   r(   r(   r)   rx  V  r  rx  )dr&   
__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pydanticpathlibr   r   r   r   r  r   r/   r   r*   r9   rE   _AttachmentLikerF   ExampleUploadWithAttachmentsrf   rh   rl   r   r   r   ExampleUpdateWithAttachmentsr   r   DatasetTransformationTyper   r   r   r   r   r   r   r   r   r   r   r   r   r   r
  r  r  r  r  r  r'  r*  r-  r/  r6  update_forward_refsr;  r?  rA  rD  rH  rL  rO  rU  r\  rj  rl  rm  rq  rs  rx  r(   r(   r(   r)   <module>   s    ,$$
&+	/QG		*	
6&$+1	