� ���g������dZddlmZddlmZmZmZddlmZddlm Z ddl m Z m Z m Z mZmZmZmZmZmZddlmZddlmZmZ dd lmZmZmZmZmZmZn#e $rdd l!mZmZmZmZmZmZYnwxYwdd l"m#Z#dd lm$Z$eeeed fZ%ee e&d fZ'Gd �de��Z(e e&eee&e)fe(ee&e#fffZ* eGd�de����Z+Gd�de��Z,Gd�de��Z-ee(e-ee&e)fee&e#ffZ.Gd�de��Z/e/Z0Gd�de/��Z1Gd�de��Z2Gd�de,��Z3Gd�de,��Z4Gd�d e��Z5Gd!�d"e��Z6e6Z7Gd#�d$e&e ��Z8Gd%�d&e��Z9e$d'Z:Gd(�d)ed*�+��Z;Gd,�d-e9��Z<Gd.�d/e��Z=d0�Z>Gd1�d2e��Z?Gd3�d4e?��Z@Gd5�d6e&e ��ZAGd7�d8ed*�+��ZBGd9�d:e?��ZCGd;�d<e��ZDGd=�d>eD��ZEGd?�d@eD��ZFGdA�dBe ��ZGGdC�dDe��ZHGdE�dFed*�+��ZIGdG�dHed*�+��ZJGdI�dJeH��ZKGdK�dLeH��ZLGdM�dNe��ZMGdO�dPeM��ZNeGdQ�dRe����ZOGdS�dTed*�+��ZPGdU�dVe��ZQGdW�dXed*�+��ZRGdY�dZe��ZSe3�T��Gd[�d\e��ZUGd]�d^e��ZVGd_�d`ed*�+��ZWGda�dbed*�+��ZXGdc�dde��ZYGde�dfe��ZZGdg�dhe��Z[Gdi�dje��Z\Gdk�dle��Z]Gdm�dne��Z^Gdo�dpe&e ��Z_Gdq�dred*�+��Z`Gds�dted*�+��ZaGdu�dve��ZbGdw�dxe��Zcd S)yzSchemas 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�(�eZdZUdZded<ded<dS)� 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__���a/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/langsmith/schemas.pyrr2s3���������"�N�N�N������r*rc�.�eZdZdZddd�Zddd �Zdd �Zd S)� BinaryIOLikez$Protocol for binary IO-like objects.������size�int�return�bytesc��dS)zRead function.Nr))�selfr/s r+�readzBinaryIOLike.readQ��� �r*r�offset�whencec��dS)zSeek function.Nr))r4r7r8s r+�seekzBinaryIOLike.seekUr6r*c��dS)zGet value function.Nr)�r4s r+�getvaluezBinaryIOLike.getvalueYr6r*N)r.)r/r0r1r2)r)r7r0r8r0r1r0)r1r2)r$r%r&r'r5r:r=r)r*r+r-r-Ms`������.�.� � � � � � � � � � � � � � � � r*r-c��eZdZUdZded<ed���Zded<ed���Zded<ed���Zded <Gd �d ��Z dS) � ExampleBasezExample base model.r� dataset_idN��default�Optional[Dict[str, Any]]�inputs�outputs�metadatac��eZdZdZdZdZdS)�ExampleBase.Config�#Configuration class for the schema.TN)r$r%r&r'�frozen�arbitrary_types_allowedr)r*r+�ConfigrHfs!������1�1���"&���r*rL) r$r%r&r'r(rrDrErFrLr)r*r+r?r?^s��������������',�u�T�':�':�':�F�:�:�:�:�(-��d�(;�(;�(;�G�;�;�;�;�).��t�)<�)<�)<�H�<�<�<�<�'�'�'�'�'�'�'�'�'�'r*r?c�$�eZdZUded<ded<dS)�_AttachmentDictrr r!r"N)r$r%r&r(r)r*r+rNrNms'��������N�N�N������r*rNc����eZdZUdZded<ed����Zded<ed� ��Zd ed <ed� ��Zd ed <ed� ��Z d ed <dZ ded<dZ ded<dZ ded<dZ ded<dZded<�fd�Z�xZS)� ExampleCreatez Example upload with attachments.�Optional[UUID]�idc�>�tjtj��S�N�r�nowr�utcr)r*r+�<lambda>zExampleCreate.<lambda>{�����h�l�9S�9S�r*��default_factoryr� created_atNrArCrDrErF�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��jdi|��dS�zInitialize from dict.Nr)��super�__init__�r4r"� __class__s �r+rizExampleCreate.__init__��&�������� � �4� � � � � r*)r$r%r&r'r(rr\rDrErFr^r_rarcrdri� __classcell__�rks@r+rPrPws��������*�*����� �5�1S�1S�T�T�T�J�T�T�T�T�',�u�T�':�':�':�F�:�:�:�:�(-��d�(;�(;�(;�G�;�;�;�;�).��t�)<�)<�)<�H�<�<�<�<�-1�E�1�1�1�1�8<�K�<�<�<�<�#��#�#�#�#�6:��:�:�:�:�$(�M�(�(�(�(�!�!�!�!�!�!�!�!�!r*rPc��eZdZUdZded<dS)�ExampleUpsertWithAttachmentsz Example create with attachments.rr@Nr#r)r*r+rprp�s$�������*�*������r*rpc�2�eZdZUdZded<ded<ded<dS) �AttachmentInfozInfo for an attachment.r� presigned_urlr-�reader� Optional[str]r Nr#r)r*r+rrrr�s<�������!�!��������������r*rrc�f��eZdZUdZded<ed����Zded<eed��� ��Zded <ed � ��Z d ed <ee ���Z ded<d Z ded<ed � ��Z ded< ed � ��Zded<ed � ��Zded< dd�fd� Zed d���Zd�Z�xZS)!�ExamplezExample model.rrRc�B�tjdtj���S)Nr)�tz)r� fromtimestamprrWr)r*r+rXzExample.<lambda>�s��� 6�q�X�\� J� J� J�r*rZrr\z$00000000-0000-0000-0000-000000000000rAr@N�Optional[datetime]� modified_atz List[Run]�runsrQrdz#Optional[Dict[str, AttachmentInfo]]r_ru� _host_url� _tenant_id�kwargsr r1�Nonec �V��t��jdi|��||_||_dS)�Initialize a Dataset object.Nr))rhrir~r)r4r~rr�rks �r+rizExample.__init__�s4��� �����"�"�6�"�"�"�"���$����r*c��|jrDd|j�d|j��}|jr |j�dt |j���|��S|j�|��SdS)�URL of this run within the app.� /datasets/z/e/�/o/N)r~r@rRrr)r4�paths r+�urlz Example.url�so�� �>� -�=���=�=�D�G�=�=�D��� J��.�I�I�S���-A�-A�I�4�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='�'))rkrRr@r�r<s r+�__repr__zExample.__repr__�s3���.�a�a�d�g�a�a�D�O�a�a�UY�U]�a�a�a�ar*)NN)r~rurrQr�r r1r��r1ru)r$r%r&r'r(rr\rr@r|�listr}rdr_rr~rri�propertyr�r�rmrns@r+rwrw�s����������� �H�H�H� �5�J�J����J������u�T�T�*P�%Q�%Q�R�R�R�J�R�R�R�R�&+�e�D�&9�&9�&9�K�9�9�9�9��e�D�1�1�1�D�1�1�1�1�$(�M�(�(�(�(�7<�u�T�7J�7J�7J�K�J�J�J�J�.�*�{�4�8�8�8�I�8�8�8�8�!,��T�!:�!:�!:�J�:�:�:�:�$(�%)� %� %� %� %� %� %� %������X��b�b�b�b�b�b�br*rwc��eZdZUdZded<dS)� ExampleSearchzExample returned via search.rrRNr#r)r*r+r�r��s�������&�&� �H�H�H�H�Hr*r�c�\�eZdZUdZeed���Zded<eed���Z ded<d S) �AttachmentsOperationsz%Operations to perform on attachments.z,Mapping of old attachment names to new names)r[� descriptionzDict[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~�������/�/�"�U��*X����F��������*L����F������r*r�c����eZdZUdZded<dZded<ed���Zded <ed���Zded <ed���Z ded <dZ d ed <dZ ded<dZ ded<Gd�d��Z �fd�Z�xZS)� ExampleUpdatez Example update with attachments.rrRNrQr@rArCrDrErFr]r^zOptional[Attachments]r_zOptional[AttachmentsOperations]�attachments_operationsc��eZdZdZdZdS)�ExampleUpdate.ConfigrITN�r$r%r&r'rJr)r*r+rLr���������1�1����r*rLc �:��t��jdi|��dSrfrgrjs �r+rizExampleUpdate.__init__�rlr*)r$r%r&r'r(r@rrDrErFr^r_r�rLrirmrns@r+r�r��s��������*�*� �H�H�H�!%�J�%�%�%�%�',�u�T�':�':�':�F�:�:�:�:�(-��d�(;�(;�(;�G�;�;�;�;�).��t�)<�)<�)<�H�<�<�<�<�-1�E�1�1�1�1�)-�K�-�-�-�-�>B��B�B�B�B��������� !�!�!�!�!�!�!�!�!r*r�c��eZdZdZdZdZdZdS)�DataTypezEnum for dataset data types.�kv�llm�chatN)r$r%r&r'r�r�r�r)r*r+r�r��s#������&�&� �B� �C� �D�D�Dr*r�c�T�eZdZUdZded<dZded<dZded<Gd �d ��ZdS) � DatasetBasezDataset base model.r�nameNrur�zOptional[DataType]� data_typec��eZdZdZdZdS)�DatasetBase.ConfigrITNr�r)r*r+rLr��r�r*rL)r$r%r&r'r(r�r�rLr)r*r+r�r��so��������� �I�I�I�!%�K�%�%�%�%�$(�I�(�(�(�(����������r*r�)�remove_system_messages�convert_to_openai_message�convert_to_openai_tool�remove_extra_fields�extract_tools_from_runc�(�eZdZUdZded<ded<dS)�DatasetTransformationz#Schema for dataset transformations.r�r�z%Union[DatasetTransformationType, str]�transformation_typeNr#r)r*r+r�r�s-�������-�-��O�O�O�>�>�>�>�>�>r*r�F)�totalc�6��eZdZUdZded<ded<ed���Zded <dZd ed <dZd ed <dZ ded <dZ ded<dZ ded<dZ ded<e d���Zded<e d���Zded<e d���Zded< dd�fd� Zed d���Z�xZS)!�DatasetzDataset ORM model.rrRrr\NrAr{r|� Optional[int]� example_count� session_count�last_session_start_timerC� inputs_schema�outputs_schemaz%Optional[List[DatasetTransformation]]�transformationsrur~rQr� _public_pathr�r r1r�c ����d|vr|�d��|d<d|vr|�d��|d<t��jdi|��||_||_||_dS)r��inputs_schema_definitionr��outputs_schema_definitionr�Nr))�poprhrir~rr�)r4r~rr�r�rks �r+rizDataset.__init__%s���� &�� /� /�&,�j�j�1K�&L�&L�F�?� #� &�&� 0� 0�'-�z�z�2M�'N�'N�F�#� $������"�"�6�"�"�"�"���$���(����r*c��|jrU|jr|j�|j��S|jr&|j�dt|j���d|j��S|j�d|j��SdS)r�r�r�N)r~r�rrrRr<s r+r�z Dataset.url8s��� �>� :�� � >��.�=�$�*;�=�=�=��� W��.�V�V�S���-A�-A�V�V�T�W�V�V�V��n�9�9���9�9� 9��tr*)NNN) r~rurrQr�rur�r r1r�r�)r$r%r&r'r(rr|r�r�r�r�r�r�rr~rr�rir�r�rmrns@r+r�r�si���������� �H�H�H�����&+�e�D�&9�&9�&9�K�9�9�9�9�#'�M�'�'�'�'�#'�M�'�'�'�'�26��6�6�6�6�.2�M�2�2�2�2�/3�N�3�3�3�3�=A�O�A�A�A�A�*�{�4�8�8�8�I�8�8�8�8�!,��T�!:�!:�!:�J�:�:�:�:�"-�+�d�";�";�";�L�;�;�;�;�$(�%)�&*� )�)�)�)�)�)�)�&�����X�����r*r�c�,�eZdZUdZdZded<ded<dS)�DatasetVersionz%Class representing a dataset version.Nrb�tagsr�as_of)r$r%r&r'r�r(r)r*r+r�r�Ds0�������/�/� $�D�$�$�$�$��O�O�O�O�Or*r�c� �diiS)NrFr)r)r*r+�_default_extrar�Ks �� �� �r*c��eZdZUdZded< ded< ded< ded< d Zd ed < ee� ��Zd ed< d Z ded< d Z d ed< d Z ded< ee � ��Z ded< d Zd ed< d Zded< d Zded< d Zded< ee � ��Zded< ed%d ���Zed&d!���Zd"�ZGd#�d$��Zd S)'�RunBasea3Base 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. rrRrr�r� start_time�run_typeNr{�end_timerZ�Optional[dict]�extraru�error� serializedzOptional[List[Dict]]�eventsr�rDrErQ�reference_example_id� parent_run_idrbr�z-Union[Attachments, Dict[str, AttachmentInfo]]r_r1�dict[str, Any]c�T�|j�i|_|j�di��S�zRetrieve the metadata (if any).NrF)r�� setdefaultr<s r+rFzRunBase.metadata�s+�� �:� ��D�J��z�$�$�Z��4�4�4r*c�6�|j�d��S)z"Retrieve the revision ID (if any).� revision_id)rF�getr<s r+r�zRunBase.revision_id�s���}� � ��/�/�/r*c�F�|j�d|j�d|j�d|j�d�S)r�r�z, name='z ', run_type='r�)rkrRr�r�r<s r+r�zRunBase.__repr__�s1���.�`�`�d�g�`�`�t�y�`�`�t�}�`�`�`�`r*c��eZdZdZdZdS)�RunBase.ConfigrITN)r$r%r&r'rKr)r*r+rLr��s������1�1�"&���r*rL�r1r�)r1rQ)r$r%r&r'r(r�rr�r�r�r�r�r�rDrEr�r�r�r_r�rFr�r�rLr)r*r+r�r�Os���������� �H�H�H�(� �I�I�I�*����� ��M�M�M�"�$(�H�'�'�'�'�-�!�E�.�A�A�A�E�A�A�A�A�=��E�����;�!%�J�%�%�%�%�F�#'�F�'�'�'�'���5��.�.�.�F�.�.�.�.�"�"�G�"�"�"�"�/�+/��/�/�/�/�@�$(�M�(�(�(�(�@� $�D�$�$�$�$�6�AF���B�B�B�K�����4��5�5�5��X�5� �0�0�0��X�0�a�a�a�'�'�'�'�'�'�'�'�'�'r*r�c���eZdZUdZdZded< dZded< dZded< dZd ed < dZ d ed < dZ ded < dZ d ed< dZ ded< dZ ded< dZded< dZded< dZded< dZded< dZded< dZded< ded< ed���Zded< dZd ed!< ed���Zd ed"<d)d*�fd'� Zed+d(���Z�xZS),�Runz$Run schema when loading from the DB.NrQ� session_id�Optional[List[UUID]]� child_run_idszOptional[List[Run]]� child_runsrC�feedback_statsru�app_path� manifest_id�statusr�� prompt_tokens�completion_tokens� total_tokensr{�first_token_time�Optional[Decimal]� total_cost� prompt_cost�completion_cost�parent_run_idsr�trace_id�rAr� dotted_order�Optional[bool]� in_datasetr~r�r r1r�c �r��|�d��sd|�d��i|�}|�dd��pi}t��jdi|�d|i��||_|j���s0|js+|j� ���|j ��|_dSdSdS)�Initialize a Run object.r�rRrDNr)) r�r�rhrir~r��stripr�r�� isoformatrR)r4r~r�rDrks �r+riz Run.__init__�s�����z�z�*�%�%� >� �&�*�*�T�"2�"2�=�f�=�F����H�d�+�+�1�r�������1�1�6�1�1�&�1�1�1�1�"���� �&�&�(�(� J��1C� J�#'�?�#<�#<�#>�#>� I��� I� I�D� � � � J� J� J� Jr*c�B�|jr|jr|j�|j��SdS)r�N)r~r�r<s r+r�zRun.url�s1�� �>� 6�d�m� 6��n�5�d�m�5�5� 5��tr*rT�r~rur�r r1r�r�)r$r%r&r'r�r(r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rr~rir�r�rmrns@r+r�r��s��������.�.�!%�J�%�%�%�%�-�*.�M�.�.�.�.�(�&*�J�*�*�*�*�M�/3�N�3�3�3�3�&�"�H�"�"�"�"�7�"&�K�&�&�&�&�:� �F� � � � �.�#'�M�'�'�'�'�/�'+��+�+�+�+�/�"&�L�&�&�&�&�1�+/��/�/�/�/�-�$(�J�(�(�(�(�M�%)�K�)�)�)�)�G�)-�O�-�-�-�-�C�+/�N�/�/�/�/�!��N�N�N�C���b�)�)�)�L�)�)�)�)� �"&�J�%�%�%�%�+�*�{�4�8�8�8�I�8�8�8�8�J�J�J�J�J�J�J������X�����r*r�c�.�eZdZdZdZdZdZdZdZdZ dZ d S) � RunTypeEnumz5(Deprecated) Enum for run types. Use string directly.�tool�chainr�� retriever� embedding�prompt�parserN) r$r%r&r'rrr�rrrrr)r*r+rr�s7������?�?� �D� �E� �C��I��I� �F� �F�F�Fr*rc��eZdZUdZded<ded<ded<ded <ded <d ed <ded <ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<d ed!<ded"<d#ed$<d%S)&� RunLikeDictz&Run-like dictionary, for type-hinting.rr�rr�rr�r�rDrEr{r�r�rur�r�rQr�r��Optional[List[dict]]r�rbr��inputs_s3_urls�outputs_s3_urlsrRr�� session_namer��input_attachments�output_attachmentsrr�r�� Attachmentsr_Nr#r)r*r+r r �s2�������0�0� �I�I�I����������������� � � � �������������!�!�!�!����� � � � �����"�"�"�"�#�#�#�#�������������(�(�(�(�%�%�%�%�&�&�&�&��N�N�N����������r*r c�2�eZdZUdZdZded< dZded<dS)�RunWithAnnotationQueueInfoz&Run schema with annotation queue info.Nr{�last_reviewed_time�added_at)r$r%r&r'rr(rr)r*r+rrs>�������0�0�-1��1�1�1�1�.�#'�H�'�'�'�'�3�3r*rc�b�eZdZUdZded< ee���Zded< dZded < dZ d ed <dS) �FeedbackSourceBasez�Base class for feedback sources. This represents whether feedback is submitted from the API, model, human labeler, etc. r�typerZrCrFNzOptional[Union[UUID, str]]�user_idru� user_name) r$r%r&r'r(rr�rFrrr)r*r+rrsp��������� �I�I�I�*�).��t�)D�)D�)D�H�D�D�D�D�6�*.�G�.�.�.�.�:�#�I�#�#�#�#�<�<r*rc�"�eZdZUdZdZded<dS)�APIFeedbackSourcezAPI feedback source.�apizLiteral['api']rN�r$r%r&r'rr(r)r*r+rr*s)��������� �D� � � � � � r*rc�"�eZdZUdZdZded<dS)�ModelFeedbackSourcezModel feedback source.�modelzLiteral['model']rNrr)r*r+r r 0s)������� � �$�D�$�$�$�$�$�$r*r c��eZdZdZdZ dZdS)�FeedbackSourceTypezFeedback source type.rr!N)r$r%r&r'�API�MODELr)r*r+r#r#6s#�������� �C�2� �E�"�"r*r#c��eZdZUdZded< dZded< dZded< ded < ded < d ed < dZd ed< dZded< dZ ded< dZ ded< dZ ded< dZ ded< dZ ded< dZded< dZded< Gd�d��ZdS)� FeedbackBasezFeedback schema.rrRNr{r\r|rQ�run_idr�r�key� SCORE_TYPE�score� VALUE_TYPE�valueru�commentzUnion[str, dict, None]� correction�Optional[FeedbackSourceBase]�feedback_sourcer��comparative_experiment_id�feedback_group_idzOptional[Dict]r�c��eZdZdZdZdS)�FeedbackBase.ConfigrITNr�r)r*r+rLr5cr�r*rL)r$r%r&r'r(r\r|r+r-r.r/r1r�r2r3r�rLr)r*r+r'r'?s\��������� �H�H�H�(�%)�J�)�)�)�)�,�&*�K�*�*�*�*�2�����<�����>� �H�H�H�A��E�����+��E�����Q�!�G�!�!�!�!�2�)-�J�-�-�-�-�!�48�O�8�8�8�8�%�!%�J�%�%�%�%�T�04��4�4�4�4�X�(,��,�,�,�,�1�!�E� � � � �'����������r*r'c�*�eZdZUdZded< ded<dS)�FeedbackCategoryz+Specific value and label pair for feedback.�floatr-ru�labelNr#r)r*r+r7r7is0�������5�5��L�L�L�C�����N�Nr*r7c�B�eZdZUdZded< ded< ded< ded<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;rsW�������D�D�:�:�:�:������4�����4�0�0�0�0�@�@r*r;c�>�eZdZUdZded< dZded< dZded<dS) �FeedbackCreatez"Schema used for creating feedback.rr1NzOptional[FeedbackConfig]�feedback_configr�r�)r$r%r&r'r(rBr�r)r*r+rArA�sL�������,�,�'�'�'�'�%�04�O�4�4�4�4�%� �E� � � � � � r*rAc�D�eZdZUdZded<ded< ded< dZded <dS) �FeedbackzSchema for getting feedback.rrRrr\r|Nr0r1)r$r%r&r'r(r1r)r*r+rDrD�sP�������&�&� �H�H�H�����,�����2�48�O�8�8�8�8�2�2r*rDc���eZdZUdZded< ed����Zded< dZd ed < dZd ed < dZ d ed < dZ ded< ded< ded< e d���Z d ed<dd �fd� Z ed!d���Zed"d���Zed#d���Z�xZS)$� TracerSessionzbTracerSession schema for the API. Sessions are also referred to as "Projects" in the UI. rrRc�>�tjtj��SrTrUr)r*r+rXzTracerSession.<lambda>�rYr*rZrr�Nr{r�rur�r�rCr�� tenant_idrQ�reference_dataset_idrAr~r�r r1r�c ���t��jdi|��||_|jj�,|j�t j���|_dSdS)r�N)�tzinfor))rhrir~r�rK�replacerrW)r4r~r�rks �r+rizTracerSession.__init__�sZ��������"�"�6�"�"�"�"��� �?� !� )�"�o�5�5�X�\�5�J�J�D�O�O�O� *� )r*c�F�|jr|j�d|j�d|j��SdS)r�r�z /projects/p/N)r~rHrRr<s r+r�zTracerSession.url�s6�� �>� O��n�N�N���N�N�T�W�N�N� N��tr*r�c�@�|j� d|jvriS|jdSr��r�r<s r+rFzTracerSession.metadata��*�� �:� ��4�:�!=�!=��I��z�*�%�%r*r�c�@�|j� d|jvrgS|jdS)zRetrieve the tags (if any).Nr�rOr<s r+r�zTracerSession.tags�s*�� �:� ��t�z�!9�!9��I��z�&�!�!r*rTrr�r�)r1r�)r$r%r&r'r(rr�r�r�r�r�rr~rir�r�rFr�rmrns@r+rFrF�sq����������  �H�H�H� � �5�1S�1S�T�T�T�J�T�T�T�T�+�#'�H�'�'�'�'�)�!%�K�%�%�%�%�)��D�����"�&*�E�*�*�*�*�)��O�O�O�0�(�(�(�(�J�*�{�4�8�8�8�I�8�8�8�8�K�K�K�K�K�K�K������X�� �&�&�&��X�&� �"�"�"��X�"�"�"�"�"r*rFc���eZdZUdZded< ded< ded< ded< ded< ded < d ed < d ed < ded< ded< ded< ded< ded< ded< ded<dS)�TracerSessionResultzqA project, hydrated with additional information. Sessions are also referred to as "Projects" in the UI. r�� run_countzOptional[timedelta]� latency_p50� latency_p99r�r�r�r{�last_run_start_timerCr�zOptional[List[Dict[str, Any]]]� run_facetsr�r�r�r��first_token_p50�first_token_p99r<� error_rateNr#r)r*r+rSrS�s���������� ����,�$�$�$�$�?�$�$�$�$�6�����=� � � � �D�$�$�$�$�H�+�+�+�+�8�,�,�,�,�)�.�.�.�.�-�!�!�!�!�M�"�"�"�"�G�&�&�&�&�C�(�(�(�(�G�(�(�(�(�>�����)�)r*rSc�D�eZdZUdZded< ded< ed d���ZdS) �BaseMessageLikez7A protocol representing objects similar to BaseMessage.r�contentzDict[Any, Any]�additional_kwargsr1c��dS)z,Type of the Message, used for serialization.Nr)r<s r+rzBaseMessageLike.type�s���r*N)r1r)r$r%r&r'r(r�rr)r*r+r]r]�sU�������A�A��L�L�L�%�%�%�%�%�C� �;�;�;��X�;�;�;r*r]c�6�eZdZUdZded< ded< ded<dS)�DatasetShareSchemaz*Represents the schema for a dataset share.rr@� share_tokenrr�Nr#r)r*r+rbrbs?�������4�4����� �����,� �H�H�H�(�(r*rbc��eZdZUdZded< ded< dZded< ed �� ��Zd ed < ed �� ��Zd ed< ded<dS)�AnnotationQueuezRepresents an annotation queue.rrRrr�Nrur�c�>�tjtj��SrTrUr)r*r+rXzAnnotationQueue.<lambda>rYr*rZrr\c�>�tjtj��SrTrUr)r*r+rXzAnnotationQueue.<lambda>rYr*� updated_atrH) r$r%r&r'r(r�rr\rhr)r*r+rere s��������)�)� �H�H�H�8� �I�I�I�+�!%�K�%�%�%�%�:� �5�1S�1S�T�T�T�J�T�T�T�T�>� �5�1S�1S�T�T�T�J�T�T�T�T�C��O�O�O�D�Dr*rec�Z�eZdZUdZded< ded< ded< ded< ded< d ed <d S) �BatchIngestConfigz"Configuration for batch ingestion.r`�use_multipart_endpointr0�scale_up_qsize_trigger�scale_up_nthreads_limit�scale_down_nempty_trigger� size_limitr��size_limit_bytesNr#r)r*r+rjrjsl�������,�,� � � � �D�����<� � � � �7�"�"�"�"�A��O�O�O�/�#�#�#�#�8�8r*rjc�R�eZdZUdZdZded< dZded< dZded < dZd ed <dS) � LangSmithInfoz'Information about the LangSmith server.r�r�versionNr{�license_expiration_timezOptional[BatchIngestConfig]�batch_ingest_configrC�instance_flags) r$r%r&r'rsr(rtrurvr)r*r+rrrr-sg�������1�1��G�����.�26��6�6�6�6�+�7;��;�;�;�;��/3�N�3�3�3�3�3�3r*rrc�F�eZdZUdZded< ded< ded< dZded <dS) �LangSmithSettingsz"Settings for the LangSmith tenant.rrR� display_namerr\Nru� tenant_handle)r$r%r&r'r(rzr)r*r+rxrx<sS�������,�,� �G�G�G������)�����*�#'�M�'�'�'�'�'�'r*rxc�6�eZdZUdZded< ded< ded<dS) �FeedbackIngestTokenz2Represents the schema for a feedback ingest token.rrRrr�r� expires_atNr#r)r*r+r|r|Hs<�������<�<� �H�H�H�.� �H�H�H�3�����+�+r*r|c�6�eZdZUdZded< ded< ded<dS) �RunEventzRun event schema.rr�zUnion[datetime, str]�timerCr�Nr#r)r*r+rrSs?��������� �I�I�I�������$�$�$�$�,�,r*rc�6�eZdZUdZded< ded< ded<dS)�TimeDeltaInputzTimedelta input schema.r0�days�hours�minutesNr#r)r*r+r�r�^s9�������!�!� �I�I�I���J�J�J���L�L�L��r*r�c�6�eZdZUdZded< ded< ded<dS)�DatasetDiffInfoz;Represents the difference information between two datasets.z List[UUID]�examples_modified�examples_added�examples_removedNr#r)r*r+r�r�isB�������E�E�!�!�!�!�=�����:� � � � �<�<r*r�c��eZdZUdZded< dZded< dZded< ded< d ed < d ed < ded < dZd ed< dZded< dZ d ed< e dd���Z dS)�ComparativeExperimentz�Represents a comparative experiment. This information summarizes evaluation results comparing two or more models on a given dataset. rrRNrur�r�rHrr\r|rIrCr�r �experiments_infor�r1r�c�@�|j� d|jvriS|jdSr�rOr<s r+rFzComparativeExperiment.metadata�rPr*r�) r$r%r&r'r(r�r�r�r�r�r�rFr)r*r+r�r�ts����������  �H�H�H�?��D�����:�!%�K�%�%�%�%�@��O�O�O�G�����D�����J�����J�&*�E�*�*�*�*�?�-1��1�1�1�1�\�/3�N�3�3�3�3�P� �&�&�&��X�&�&�&r*r�c�N�eZdZUdZded< ded< ded< ded< ded <d S) � PromptCommitz$Represents a Prompt with a manifest.r�owner�repo� commit_hashzDict[str, Any]�manifestz List[dict]�examplesNr#r)r*r+r�r��sZ�������.�.��J�J�J�0� �I�I�I�!�����(�����%������r*r�c���eZdZUdZded< ded< ded< dZded < dZded < dZded < dZd ed < dZ ded< dZ ded< e e ���Z ded< dZded< dZded< dZd ed<dS)�ListedPromptCommitz;Represents a listed prompt commit with associated metadata.rrRrr�r�NrQr��repo_id� parent_idrur�r{r\rhrZr��example_run_idsrr�� num_downloads� num_views�parent_commit_hash)r$r%r&r'r(r�r�r�r�r\rhrr�r�r�r�r�r)r*r+r�r��s�������E�E� �H�H�H�6��J�J�J�)� �I�I�I�3�"&�K�&�&�&�&�O�"�G�"�"�"�"�5� $�I�$�$�$�$�8�!%�K�%�%�%�%�*�%)�J�)�)�)�)�=�%)�J�)�)�)�)�B�,1�E�$�,G�,G�,G�O�G�G�G�G�H�#$�M�$�$�$�$�>� �I� � � � �:�(,��,�,�,�,�1�1r*r�c�:�eZdZUdZded< dZded< dZded< ded< ded < d ed < d ed < d ed< d ed< ded< dZded< dZded< ded< ded< ded< ded< ded< dZ ded< dZ ded< ded< dZ ded< dZ ded<dS) �Promptz"Represents a Prompt with metadata.r� repo_handleNrur��readmerRrHrr\rhr`� is_public� is_archivedr�r��original_repo_id�upstream_repo_idr�� full_namer0� num_likesr�r�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�r�r�r�r�r�r�r)r*r+r�r��sx�������,�,�����!�!%�K�%�%�%�%�(� �F� � � � �#� �G�G�G���N�N�N�,�����*�����-��O�O�O�'�����)��O�O�O�.�&*��*�*�*�*�3�&*��*�*�*�*�3�����0��N�N�N�<��N�N�N������"��N�N�N��)-��-�-�-�-�@�&*��*�*�*�*�&����� �-1��1�1�1�1�:�-1��1�1�1�1�:�:r*r�c�*�eZdZUdZded< ded<dS)�ListPromptsResponsez A list of prompts with metadata.z List[Prompt]�reposr0r�Nr#r)r*r+r�r�s0�������*�*�������J�J�J�&�&r*r�c�(�eZdZdZdZ dZ dZ dZdS)�PromptSortFieldz$Enum for sorting fields for prompts.r�r�rhr�N)r$r%r&r'r�r�rhr�r)r*r+r�r� s3������.�.�#�M���I���J���I��r*r�c�6�eZdZUdZded< ded< ded<dS)�InputTokenDetailsz~Breakdown of input token counts. Does *not* need to sum to full input token count. Does *not* need to have all keys. r0�audio�cache_creation� cache_readNr#r)r*r+r�r�sJ��������� �J�J�J��������O�O�O��r*r�c�*�eZdZUdZded< ded<dS)�OutputTokenDetailsz�Breakdown of output token counts. Does *not* need to sum to full output token count. Does *not* need to have all keys. r0r�� reasoningNr#r)r*r+r�r�.s7��������� �J�J�J���N�N�N��r*r�c�N�eZdZUdZded< ded< ded< ded< ded <d S) � UsageMetadataz�Usage metadata for a message, such as token counts. This is a standard representation of token usage that is consistent across models. r0� input_tokens� output_tokensr�zNotRequired[InputTokenDetails]�input_token_detailszNotRequired[OutputTokenDetails]�output_token_detailsNr#r)r*r+r�r�>sn��������� ����J�����P�����A�7�7�7�7��:�9�9�9��r*r�c�*�eZdZUdZded< ded<dS)�UpsertExamplesResponsezCResponse object returned from the upsert_examples_multipart method.r0�countr�� example_idsNr#r)r*r+r�r�Vs0�������M�M��J�J�J�4�����5�5r*r�)dr'� __future__rrrr�decimalr�enumr�typingr r r r r rrrr�uuidr�typing_extensionsrr� pydantic.v1rrrrrr� ImportError�pydantic�pathlibrrr*rr,rr2rr-r?rN�_AttachmentLikerP�ExampleUploadWithAttachmentsrprrrwr�r�r��ExampleUpdateWithAttachmentsr�r��DatasetTransformationTyper�r�r�r�r�r�rr rrrr r#r'r7r;rArDrFrSr]rbrerjrr�update_forward_refsrxr|rr�r�r�r�r�r�r�r�r�r�r�r�r)r*r+�<module>r�s� ��$�$�"�"�"�"�"�"�2�2�2�2�2�2�2�2�2�2������������� � � � � � � � � � � � � � � � � � � � � � �������4�4�4�4�4�4�4�4����������������������������������������������������%�%�%�%�%�%� �:�y�+�t�;� <� � �4��d�?� #� ����������,�3��e�C��J�/��U�3��9�=M�M�N�N�O� �J��  �  �  �  �  �8�  �  ���  � '� '� '� '� '�)� '� '� '������i���� ����s�E�z�!2�E�#�t�)�4D�D��� !�!�!�!�!�I�!�!�!�& -�������=���� �����Y����(b�(b�(b�(b�(b�k�(b�(b�(b�V � � � � �K� � � � �����I����!�!�!�!�!�I�!�!�!�, -�������s�D���� � � � � �)� � � �$����?�?�?�?�?�I�U�?�?�?�?�,�,�,�,�,�k�,�,�,�^�����Y�������N'�N'�N'�N'�N'�i�N'�N'�N'�bD�D�D�D�D�'�D�D�D�N � � � � �#�t� � � ������)�5�����:4�4�4�4�4��4�4�4�=�=�=�=�=��=�=�=�"!�!�!�!�!�*�!�!�!� %�%�%�%�%�,�%�%�%� #�#�#�#�#��#�#�#�'�'�'�'�'�9�'�'�'�TO�O�O�O�O�y��O�O�O�O� @� @� @� @� @�Y�e� @� @� @� @�!�!�!�!�!�\�!�!�!� 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�" 4� 4� 4� 4� 4�I� 4� 4� 4������� (� (� (� (� (� � (� (� (�,�,�,�,�,�)�,�,�,�-�-�-�-�-�y��-�-�-�-������Y�e�����=�=�=�=�=�i�=�=�=�!&�!&�!&�!&�!&�I�!&�!&�!&�H  �  �  �  �  �9�  �  �  �(2�(2�(2�(2�(2��(2�(2�(2�V.;�.;�.;�.;�.;�Y�.;�.;�.;�b'�'�'�'�'�)�'�'�'� � � � � �c�4� � � ������ ������* � � � � ��%� � � � � �����I����06�6�6�6�6�Y�6�6�6�6�6s�A�A-�,A-
Memory