Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
schemas.cpython-313.pyc316 linesDownload Raw Back to __pycache__
1�

2��jW���l�SrSSKJr SSKJr SSKJrJrJr SSKJ	r	 SSK3Jr SSKJ
r
 SSKJrJrJrJrJrJrJr SS	KJr SS4KJrJrJrJrJrJrJr SSK J!r!J"r"J#r# \\\\S4r$\\%\&\\\S4r'"S
S\5r(\%\&\\)\&\*4\(\)\&\
444r+\"SS\55r,"SS\5r-"SS\#5r.\\(\.\)\&\*4\)\&\
44r/"SS\5r0\0r1"SS\05r2"SS\#5r3"SS\-5r4"SS\5r5"SS \5r6\6r7"S!S"\&\5r8"S#S$\5r9\!S%r:"S&S'\#S(S)9r;"S*S+\95r<"S,S-\5r=S.r>"S/S0\5r?"S1S2\?5r@"S3S4\&\5rA"S5S6\#S(S)9rB"S7S8\?5rC"S9S:\5rD"S;S<\D5rE"S=S>\D5rF"S?S@\5rG"SASB\5rH"SCSD\#S(S)9rI"SESF\#S(S)9rJ"SGSH\H5rK"SISJ\H5rL"SKSL\5rM"SMSN\M5rN\"SOSP\55rO"SQSR\#S(S)9rP"SSST\#S(S)9rQ"SUSV\5rR"SWSX\R5rS"SYSZ\#S(S)9rT"S[S\\5rU\4R�5 "S]S^\5rW"S_S`\5rX"SaSb\#S(S)9rY"ScSd\#S(S)9rZ"SeSf\5r["SgSh\5r\"SiSj\5r]"SkSl\5r^"SmSn\5r_"SoSp\5r`"SqSr\&\5ra"SsSt\5rb"SuSv\5rc"SwSx\5rd\\\b\c\d4\"SySz94re"S{S|\5rf"S}S~\5rg"SS�\5rh"S�S�\5ri"S�S�\#S(S)9rj"S�S�\#S(S)9rk"S�S�\#S(S)9rl"S�S�\#S(S)9rm"S�S�\#5rn"S�S�\#S(S)9ro"S�S�\#5rp"S�S�\45rq"S�S�\#5rr"S�S�\#5rs"S�S�\5rt"S�S�\5ru"S�S�\5rv"S�S�\5rwSS�.S�S�jjrx"S�S�5ry"S�S�5rz"S�S�\5r{"S�S�\5r|"S�S�\5r}"S�S�\5r~"S�S�\}5r"S�S�\5r�g)�zSchemas for the LangSmith API.�)�annotations)�Iterator)�datetime�	timedelta�timezone)�Decimal)�Enum)�Path)�	Annotated�Any�5NamedTuple�Optional�Protocol�Union�runtime_checkable)�UUID)�	BaseModel�6ConfigDict�Field�PrivateAttr�7StrictBool�StrictFloat�	StrictInt)�Literal�NotRequired�	TypedDictNc�.�\rSrSr%SrS\S'S\S'Srg)	�8Attachment�$a^Annotated type that will be stored as an attachment if used.9 10Examples:11    ```python12    from langsmith import traceable13    from langsmith.schemas import Attachment14 15 16    @traceable17    def my_function(bar: int, my_val: Attachment):18        # my_val will be stored as an attachment19        # bar will be stored as inputs20        return bar21    ```22�str�	mime_type�Union[bytes, Path]�data�N��__name__�23__module__�__qualname__�__firstlineno__�__doc__�__annotations__�__static_attributes__r$��WD:\code\apps\devtools\python\user_packages\Python313\site-packages\langsmith/schemas.pyrr$s��� �N�24�r-rc�>�\rSrSrSrSS	SjjrS25SSjjrSSjrSrg)
�BinaryIOLike�@z$Protocol for binary IO-like objects.c��g)zRead function.Nr$)�self�sizes  r.�read�BinaryIOLike.readD���r-c��g)zSeek function.Nr$)r3�offset�whences   r.�seek�BinaryIOLike.seekHr7r-c��g)zGet value function.Nr$�r3s r.�getvalue�BinaryIOLike.getvalueLr7r-r$N)�����)r4�int�return�bytes)r)r9rBr:rBrCrB)rCrD)	r&r'r(r)r*r5r;r?r,r$r-r.r0r0@s��.���r-r0c�t�\rSrSr%SrS\S'\"SS9rS\S'\"SS9rS\S	'\"SS9r	S\S26'\27"SSS9rS
rg)�ExampleBase�QzExample base model.r�28dataset_idN��default�Optional[dict[str, Any]]�inputs�outputs�metadataT)�frozen�arbitrary_types_allowedr$)
r&r'r(r)r*r+rrLrMrNr�model_configr,r$r-r.rFrFQsG�����',�T�':�F�$�:�(-�d�(;�G�
%�;�).�t�)<�H�&�<��T�4�H�Lr-rFc�*�\rSrSr%S\S'S\S'Srg)�_AttachmentDict�\r r!r"r#r$N)r&r'r(r)r+r,r$r-r.rSrS\s
���N�29�r-rSc��^�\rSrSr%SrSrS\S'\"SS9rS\S	'\"SS309r	S\S'\"SS319r32S\S
'\"SS339rS\S'SrS\S'Sr
S\S'SrS\S'SrS\S'SrS\S'U4SjrSrU=r$)�
ExampleCreate�fz Example upload with attachments.N�Optional[UUID]�idc�J�[R"[R5$�N�r�nowr�utcr$r-r.�<lambda>�ExampleCreate.<lambda>j������h�l�l�9Sr-��default_factoryr�34created_atrIrKrLrMrN�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�&>�[TU]"S0UD6 g�zInitialize from dict.Nr$��super�__init__�r3r#�	__class__s  �r.rq�ExampleCreate.__init__t����
��� �4� r-r$)r&r'r(r)r*rYr+rrdrLrMrNrfrgrirkrlrqr,�
__classcell__�rss@r.rVrVfs����*��B��� �1S�T�J��T�',�T�':�F�$�:�(-�d�(;�G�
%�;�).�t�)<�H�&�<�-1�E�*�1�8<�K�5�<�#��t�#�6:�� 3�:�$(�M�>�(�!�!r-rVc�$�\rSrSr%SrS\S'Srg)�ExampleUpsertWithAttachments�|z Example create with attachments.rrHr$Nr%r$r-r.ryry|s��*��r-ryc�8�\rSrSr%SrS\S'S\S'S\S'S	rg35)�AttachmentInfo�zInfo for an attachment.r �
presigned_urlr0�reader�
Optional[str]r!r$Nr%r$r-r.r|r|�s��!������r-r|c�^�\rSrSr%SrS\S'\"SS9rS\S'\"\"S	5S369r	S\S'\"SS379r38S
\S'SrS\S'\"SS399rS\S'\
"SS409rS\S'\
"SS419rS\S'SSU4Sjjjr\SSj5rSrSrU=r$)�Example�zExample model.rrYc�H�[R"S[RS9$)Nr)�tz)r�
fromtimestamprr^r$r-r.r_�Example.<lambda>�s��� 6� 6�q�X�\�\� Jr-rbrrdz$00000000-0000-0000-0000-000000000000rIrHN�Optional[datetime]�modified_atrXrlz#Optional[dict[str, AttachmentInfo]]rgr��	_host_url�42_tenant_idc�>>�[TU]"S0UD6 XlX lg)�Initialize a Dataset object.Nr$)rprqr�r�)r3r�r��kwargsrss    �r.rq�Example.__init__�s���	���"�6�"�"��$�r-c���UR(acSURSUR3nUR(a&URS[	UR5U3$URU3$g)�URL of this run within the app.�43/datasets/z/e/�/o/N)r�rHrYr�r )r3�paths  r.�url�Example.url�sh���>�>�����0��D�G�G�9�=�D�����.�.�)��S����-A�,B�4�&�I�I��n�n�%�d�V�,�,�r-c�n�URSURSURSURS3$)�5Return a string representation of the RunBase object.�(id=z
, dataset_id=z, link='�'))rsrYrHr�r>s r.�__repr__�Example.__repr__�s8���.�.�!��d�g�g�Y�m�D�O�O�;L�H�UY�U]�U]�T^�^`�a�ar-)r�r�)NN)r�r�r�rXr�rrC�None�rCr�)r&r'r(r)r*r+rrdrrHr�rlrgrr�r�rq�propertyr�r�r,rvrws@r.r�r��s������H� �J��J����T�*P�%Q�R�J��R�&+�D�&9�K�#�9�$(�M�>�(�7<�T�7J�K�4�J�.�*�4�8�I�}�8�!,�T�!:�J��:�$(�%)�	%� �	%�#�	%��		%�4445�	%�	%�����b�br-r�c�J�\rSrSr%Sr\"\SS9rS\S'\"\	SS9r46S\S	'S47rg)�AttachmentsOperations�z%Operations to perform on attachments.z,Mapping of old attachment names to new names)rc�descriptionzdict[str, str]�renamez List of attachment names to keep�	list[str]�retainr$N)r&r'r(r)r*r�dictr�r+�listr�r,r$r-r.r�r��s5��/�"��*X��F�N����*L��F�I�r-r�c�^�\rSrSr%SrS\S'SrS\S'\"SS9rS	\S48'\"SS9r	S	\S'\"SS9r49S	\S'SrS
\S'SrS\S'Sr
S\S'\"SS9rU4SjrSrU=r$)�
ExampleUpdate�z Example update with attachments.rrYNrXrHrIrKrLrMrNrerfzOptional[Attachments]rgzOptional[AttachmentsOperations]�attachments_operationsT�rOc�&>�[TU]"S0UD6 grnrorrs  �r.rq�ExampleUpdate.__init__�rur-r$)r&r'r(r)r*r+rHrrLrMrNrfrgr�rrQrqr,rvrws@r.r�r��s{���*��H�!%�J��%�',�T�':�F�$�:�(-�d�(;�G�
%�;�).�t�)<�H�&�<�-1�E�*�1�)-�K�&�-�>B��;�B��T�*�L�!�!r-r�c�$�\rSrSrSrSrSrSrSrg)�DataType��zEnum for dataset data types.�kv�llm�chatr$N)	r&r'r(r)r*r�r�r�r,r$r-r.r�r��s��&�	
�B�50�C��Dr-r�c�L�\rSrSr%SrS\S'SrS\S'SrS\S	'\"S51S9r	Sr52g)
�DatasetBase��zDataset base model.r �nameNr�r�zOptional[DataType]�	data_typeTr�r$)r&r'r(r)r*r+r�r�rrQr,r$r-r.r�r��s)���53
�I�!%�K��%�$(�I�!�(��T�*�Lr-r�)�remove_system_messages�convert_to_openai_message�convert_to_openai_tool�remove_extra_fields�extract_tools_from_runc�.�\rSrSr%SrS\S'S\S'Srg)	�DatasetTransformation��z#Schema for dataset transformations.r�r�z%Union[DatasetTransformationType, str]�transformation_typer$Nr%r$r-r.r�r��s��-�54�O�>�>r-r�F)�totalc�0^�\rSrSr%SrS\S'S\S'\"SS9rS	\S55'SrS\S'Sr	S\S
'Sr56S	\S'SrS\S'SrS\S'Sr
S\S'SrS\S'\"SS9rS\S'\"SS9rS\S'\"SS9rS\S'SSU4Sjjjr\SSj5rSrU=r$) �Dataset��zDataset ORM model.rrYrrdNrIr�r��
Optional[int]�
example_count�
session_count�last_session_start_timerK�
inputs_schema�outputs_schemaz%Optional[list[DatasetTransformation]]�transformationsrNr�r�rXr��_public_pathc�>�SU;aURS5US'SU;aURS5US'[TU]"S0UD6 XlX lX0lg)r��inputs_schema_definitionr��outputs_schema_definitionr�Nr$)�poprprqr�r�r�)r3r�r�r�r�rss     �r.rq�Dataset.__init__s^���&��/�&,�j�j�1K�&L�F�?�#�&�&�0�'-�z�z�2M�'N�F�#�$�
���"�6�"�"��$��(�r-c�6�UR(a�UR(aURUR3$UR(a1URS[UR5SUR3$URSUR3$g)r�r�r�N)r�r�r�r rYr>s r.r��Dataset.urls}���>�>�� � ��.�.�)�$�*;�*;�)<�=�=�����.�.�)��S����-A�,B�*�T�W�W�I�V�V��n�n�%�Z����y�9�9�r-)r�r�r�)NNN)57r�r�r�rXr�r�r�rrCr�r�)r&r'r(r)r*r+rr�r�r�r�r�r�r�rNrr�r�r�rqr�r�r,rvrws@r.r�r��s������H���&+�D�&9�K�#�9�#'�M�=�'�#'�M�=�'�26��/�6�.2�M�+�2�/3�N�,�3�=A�O�:�A�)-�H�&�-�*�4�8�I�}�8�!,�T�!:�J��:�"-�d�";�L�-�;�$(�%)�&*�	)� �)�#�)�$�	)�58�)�59�
)�)�&���r-r�c�2�\rSrSr%SrSrS\S'S\S'Srg)	�DatasetVersioni'z%Class representing a dataset version.Nrj�tagsr�as_ofr$)r&r'r(r)r*r�r+r,r$r-r.r�r�'s��/� $�D�60�$��Or-r�c�61�S00$)NrNr$r$r-r.�_default_extrar�.s
�����r-c�`�\rSrSr%SrS\S'S\S'S\S'S\S	'S62rS\S'\"\S
9r	S\S'S63r64S\S'S65rS\S'S66rS\S'\"\
S
9rS\S'S67rS\S'S68rS\S'S69rS\S'S70rS\S'\"\
S
9rS\S'\S&Sj5r\S'S j5r\S(S!j5rS"r\"S#S$9rS%rg71))�RunBasei2aBase Run schema.72 73A Run is a span representing a single unit of work or operation within your LLM app.74This could be a single call to an LLM or chain, to a prompt formatting call,75to a runnable lambda invocation. If you are familiar with OpenTelemetry,76you can think of a run as a span.77rrYr r�r�78start_time�run_typeNr��end_timerb�Optional[dict]�extrar��error�79serialized�Optional[list[dict]]�eventsr�rLrMrX�reference_example_id�
parent_run_idrjr�z-Union[Attachments, dict[str, AttachmentInfo]]rgc�b�URc0UlURRS05$�zRetrieve the metadata (if any).rN)r��80setdefaultr>s r.rN�RunBase.metadataos,���:�:���D�J��z�z�$�$�Z��4�4r-c�8�URRS5$)z"Retrieve the revision ID (if any).�revision_id)rN�getr>s r.r��RunBase.revision_idvs���}�}� � ��/�/r-c�l�URcgURUR-81R5$)zLatency in seconds.N)r�r��
total_secondsr>s r.�latency�RunBase.latency{s-���=�=� ���
�
����/�>�>�@�@r-c�n�URSURSURSURS3$)r�r�z, name='z
', run_type='r�)rsrYr�r�r>s r.r��RunBase.__repr__�s3���.�.�!��d�g�g�Y�h�t�y�y�k��t�}�}�o�]_�`�`r-T)rP�r��rC�dict[str, Any])rCrX)rC�Optional[float])r&r'r(r)r*r+r�rr�r�r�r�r�r�rLrMr�r�r�rgr�rNr�r�r�rrQr,r$r-r.r�r�2s-���	
�H�(�82
�I�*��� ��M�"�$(�H� �'�-�!�.�A�E�>�A�=��E�=��;�!%�J��%�F�#'�F� �'����.�F�D�.�"�"�G�^�"�/�+/��.�/�@�$(�M�>�(�@� $�D�83�$�6�AF��B�K�>���84�5��5��0��0��A��A�a��d�;�Lr-r�c�d^�\rSrSr%SrSrS\S'SrS\S'SrS\S	'Sr	S85\S'Sr86S\S
'SrS\S'SrS\S'Sr
S\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S 'S!\S"'\"S#S$9rS%\S&'SrS'\S('\"SS$9rS\S)'S5S6U4S*jjjr\S7S+j5r \S8S,j5r!\S8S-j5r"\S9S.j5r#\S9S/j5r$\S:S0j5r%\S:S1j5r&\S;S2j5r'\S;S3j5r(S4r)U=r*$)<�Runi�z$Run schema when loading from the DB.NrX�87session_id�Optional[list[UUID]]�
child_run_idszOptional[list[Run]]�88child_runsrK�feedback_statsr��app_path�manifest_id�statusr��
prompt_tokens�completion_tokens�total_tokenszOptional[dict[str, int]]�prompt_token_details�completion_token_detailsr��first_token_time�Optional[Decimal]�89total_cost�prompt_cost�completion_costzOptional[dict[str, Decimal]]�prompt_cost_details�completion_cost_details�parent_run_idsr�trace_id�rIr �dotted_order�Optional[bool]�90in_datasetr�c�>�URS5(dSURS50UEnURSS5=(d 0n[TU]"S0UDSU0D6 XlUR91Rc,UR92R[RS9UlURbCURRc,URR[RS9Ul93URR5(d@UR(d.UR94R5UR3Ulggg)�Initialize a Run object.rrYrLN��tzinfor$)r�r�rprqr�r�r�replacerr^r�r�stripr��	isoformatrY)r3r�r�rLrss    �r.rq�Run.__init__�s����z�z�*�%�%� �&�*�*�T�"2�=�f�=�F����H�d�+�1�r��
���1�6�1�&�1�"���?�?�!�!�)�"�o�o�5�5�X�\�\�5�J�D�O��=�=�$����)=�)=�)E� �M�M�1�1����1�F�D�M�� � �&�&�(�(��1C�1C�#'�?�?�#<�#<�#>�"?����y� I�D��2D�(r-c�|�UR(a+UR(aURUR3$g)r�N)r�rr>s r.r��Run.url�s,���>�>�d�m�m��n�n�%�d�m�m�_�5�5�r-c��UR$)zAlias for prompt_tokens.)rr>s r.�input_tokens�Run.input_tokens�s���!�!�!r-c��UR$)zAlias for completion_tokens.)rr>s r.�
output_tokens�Run.output_tokens�s���%�%�%r-c��UR$)zAlias for prompt_cost.)rr>s r.�95input_cost�Run.input_cost�s�����r-c��UR$)zAlias for completion_cost.)rr>s r.�output_cost�Run.output_cost�s���#�#�#r-c��UR$)zAlias for prompt_token_details.)r	r>s r.�input_token_details�Run.input_token_details�s���(�(�(r-c��UR$)zAlias for output_token_details.)r96r>s r.�output_token_details�Run.output_token_details�s���,�,�,r-c��UR$)zAlias for prompt_cost_details.)rr>s r.�input_cost_details�Run.input_cost_detailss���'�'�'r-c��UR$)z"Alias for completion_cost_details.)rr>s r.�output_cost_details�Run.output_cost_details	s���+�+�+r-)r�rr�r�r[�r�r�r�rrCr�r�)rCz97int | None)rCzDecimal | None)rC�dict[str, int] | None)rCzdict[str, Decimal] | None)+r&r'r(r)r*r�r+rrrrrrrrrr	r98rr
rrrrrrrrrr�rqr�r�r#r&r)r,r/r2r5r8r,rvrws@r.r�r��s���.�!%�J��%�-�*.�M�'�.�4�&*�J�#�*�M�/3�N�,�3�&�"�H�m�"�7�"&�K��&�:� �F�M� �.�#'�M�=�'�/�'+��}�+�/�"&�L�-�&�1�59��2�9��:>��6�=��,0��(�/�-�$(�J�!�(�M�%)�K�"�)�G�)-�O�&�-�C�8<��5�<��=A��9�@��,0�N�(�/�!��N�C��b�)�L�#�)�99�"&�J��%�+�*�4�8�I�}�8�J�J������"��"��&��&�� �� ��$��$��)��)��-��-��(��(��,��,r-r�c�4�\rSrSrSrSrSrSrSrSr	Sr100S	rS101rg)�RunTypeEnumiz5(Deprecated) Enum for run types. Use string directly.�tool�chainr��	retriever�	embedding�prompt�parserr$N)
r&r'r(r)r*r>r?r�r@rArBrCr,r$r-r.r=r=s(��?��D��E�102�C��I��I�
�F�
�Fr-r=c�103�\rSrSr%SrS\S'S\S'S\S'S	\S104'S	\S'S\S
'S	\S'S\S'S	\S'S\S'S\S'S\S'S\S'S	\S'S	\S'S\S'S\S'S\S'S\S'S	\S'S	\S 'S!\S"'S\S#'S$\S%'S&rg')(�RunLikeDictiz&Run-like dictionary, for type-hinting.r r�r=r�rr�r�rLrMr�r�r�r�r�r�rXr�rr�r�rjr��inputs_s3_urls�outputs_s3_urlsrYr��session_namer��input_attachments�output_attachmentsrrr�Attachmentsrgr$Nr%r$r-r.rErEs���0�105
�I�������
�� � �������!�!��� � �106��"�"�#�#�������(�(�%�%�&�&��N����r-rEc�8�\rSrSr%SrSrS\S'SrS\S'Srg)�RunWithAnnotationQueueInfoi8z&Run schema with annotation queue info.Nr��last_reviewed_time�added_atr$)	r&r'r(r)r*rNr+rOr,r$r-r.rMrM8s"��0�-1��*�1�.�#'�H� �'�3r-rMc�\�\rSrSr%SrS\S'\"\S9rS\S'Sr	S	\S107'Sr108S\S'S
rg)�FeedbackSourceBaseiAz}Base class for feedback sources.109 110This represents whether feedback is submitted from the API, model, human labeler,111    etc.112r �typerbrKrNNzOptional[Union[UUID, str]]�user_idr��	user_namer$)r&r'r(r)r*r+rr�rNrSrTr,r$r-r.rQrQAs?����I�*�).�t�)D�H�&�D�6�*.�G�
'�.�:�#�I�}�#�<r-rQc�(�\rSrSr%SrSrS\S'Srg)�APIFeedbackSourceiRzAPI feedback source.�apizLiteral['api']rRr$N�r&r'r(r)r*rRr+r,r$r-r.rVrVRs��� �D�.� r-rVc�(�\rSrSr%SrSrS\S'Srg)�ModelFeedbackSourceiXzModel feedback source.�modelzLiteral['model']rRr$NrXr$r-r.rZrZXs�� �$�D�113�$r-rZc�"�\rSrSrSrSrSrSrg)�FeedbackSourceTypei^zFeedback source type.rWr[r$N)r&r'r(r)r*�API�MODELr,r$r-r.r]r]^s���114�C�2��E�"r-r]c��\rSrSr%SrS\S'SrS\S'SrS\S'S	\S115'S	\S'S\S
'SrS\S'Sr	S\S'Sr116S\S'SrS\S'SrS\S'Sr
S	\S'SrS\S'SrS	\S'SrS	\S'SrS\S'\"SS9rS rg)!�FeedbackBaseigzFeedback schema.rrYNr�rdr�rX�run_idrr �key�117SCORE_TYPE�score�118VALUE_TYPE�valuer��commentzUnion[str, dict, None]�119correction�Optional[FeedbackSourceBase]�feedback_sourcer�r��comparative_experiment_id�feedback_group_idr�r�Tr�r$)r&r'r(r)r*r+rdr�rergrhrirkr�r�rlrmr�rrQr,r$r-r.rarags�����H�(�%)�J�"�)�,�&*�K�#�*�2���<���>�	�H�A��E�:��+��E�:��Q�!�G�]�!�2�)-�J�&�-�!�48�O�1�8�%�!%�J��%�T�%)�J�"�)�E�04��~�4�X�(,��~�,�1�!�E�>� �'��T�*�Lr-rac�0�\rSrSr%SrS\S'S\S'Srg)	�FeedbackCategoryi�z+Specific value and label pair for feedback.�floatrgr��labelr$Nr%r$r-r.roro�s��5��L�C���Nr-roc�H�\rSrSr%SrS\S'S\S'S\S'S\S	'S120rg)�FeedbackConfigi�z:Represents _how_ a feedback value ought to be interpreted.z0Literal['continuous', 'categorical', 'freeform']rRr��min�maxz Optional[list[FeedbackCategory]]�121categoriesr$Nr%r$r-r.rsrs�s,��D�122:�:��	��4�	��4�0�0�@r-rsc�D�\rSrSr%SrS\S'SrS\S'SrS\S	'S123rg)�FeedbackCreatei�z"Schema used for creating feedback.rQrkNzOptional[FeedbackConfig]�feedback_configrr�r$)	r&r'r(r)r*r+ryr�r,r$r-r.rxrx�s&��,�'�'�%�04�O�-�4�%� �E�>� r-rxc�J�\rSrSr%SrS\S'S\S'S\S'SrS	\S124'Srg)�Feedbacki�zSchema for getting feedback.rrYrrdr�Nrjrkr$)r&r'r(r)r*r+rkr,r$r-r.r{r{�s*��&��H���,���2�48�O�1�8�2r-r{c�^�\rSrSr%SrS\S'\"SS9rS\S'S	rS125\S'S	r	S\S
'S	r126S\S'S	rS\S'S\S'S\S'\"S	S9r
S\S'SSU4Sjjjr\SSj5r\SSj5r\SSj5rSrU=r$) �
TracerSessioni�zZTracerSession schema for the API.127 128Sessions are also referred to as "Projects" in the UI.129rrYc�J�[R"[R5$r[r\r$r-r.r_�TracerSession.<lambda>�rar-rbrr�Nr�r�r�r�r�rKr��	tenant_idrX�reference_dataset_idrIr�c�>�[TU]"S0UD6 XlURRc-URR[RS9Ulgg)rNrr$)rprqr�r�rrrr^)r3r�r�rss   �r.rq�TracerSession.__init__�sJ���
���"�6�"�"���?�?�!�!�)�"�o�o�5�5�X�\�\�5�J�D�O�*r-c�v�UR(a(URSURSUR3$g)r�r��/projects/p/N)r�r�rYr>s r.r��TracerSession.url�s3���>�>��n�n�%�S����(8��T�W�W�I�N�N�r-c�^�URbSUR;a0$URS$r�r�r>s r.rN�TracerSession.metadata��-���:�:���4�:�:�!=��I��z�z�*�%�%r-c�^�URbSUR;a/$URS$)zRetrieve the tags (if any).r�r�r>s r.r��TracerSession.tags�s-���:�:���t�z�z�!9��I��z�z�&�!�!r-)r�r�r[r:r�r��rCr�)r&r'r(r)r*r+rr�r�r�r�r�rr�rqr�r�rNr�r,rvrws@r.r}r}�s�����130	
�H� � �1S�T�J��T�+�#'�H� �'�)�!%�K��%�)��D�-��"�&*�E�#�*�)��O�0�(�(�J�*�4�8�I�}�8�K�K������&��&��"��"r-r}c��\rSrSr%SrSrS\S'SrS\S'SrS\S'Sr	S\S	'Sr131S\S132'SrS\S'SrS\S
'Sr
S\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'Srg)�TracerSessionResulti�ziA project, hydrated with additional information.133 134Sessions are also referred to as "Projects" in the UI.135Nr��	run_count�Optional[timedelta]�latency_p50�latency_p99rrrr��last_run_start_timerKr�session_feedback_stats�Optional[list[dict[str, Any]]]�136run_facetsrr
rr�first_token_p50�first_token_p99r��137error_rater$)r&r'r(r)r*r�r+r�r�rrrr�rr�r�r
rrr�r�r�r,r$r-r.r�r��s����138 $�I�}�#�,�'+�K�$�+�?�'+�K�$�+�6�"&�L�-�&�=�#'�M�=�'�D�'+��}�+�H�.2��+�2�8�/3�N�,�3�)�7;��4�;�1�15�J�.�5�-�$(�J�!�(�M�%)�K�"�)�G�)-�O�&�-�C�+/�O�(�/�G�+/�O�(�/�>�"&�J��&�)r-r�c�F�\rSrSr%SrS\S'S\S'\S139Sj5rSrg	)�BaseMessageLikeiz7A protocol representing objects similar to BaseMessage.r �contentzdict[Any, Any]�additional_kwargsc��g)z,Type of the Message, used for serialization.Nr$r>s r.rR�BaseMessageLike.type$s�r-r$N�rCr )	r&r'r(r)r*r+r�rRr,r$r-r.r�r�s(��A�
�L�%�%�%�C�
�;��;r-r�c�<�\rSrSr%SrS\S'S\S'S\S'Srg	)140�DatasetShareSchemai)z*Represents the schema for a dataset share.rrH�share_tokenr r�r$Nr%r$r-r.r�r�)s��4��� ���,�	�H�(r-r�c�T�\rSrSr%SrS\S'S\S'S\S'S\S	'S141\S'Srg
)�AnnotationQueueRubricItemi4z�Represents a rubric item assigned to an annotation queue.142 143Links a feedback config to a queue with optional per-queue customization.144r �feedback_keyr�r�zOptional[dict[str, str]]�value_descriptions�score_descriptionsr�is_requiredr$Nr%r$r-r.r�r�4s6���145��=���C�0�0�7�0�0�(���Nr-r�c��\rSrSr%SrS\S'S\S'SrS\S	'\"S146S9rS\S
'\"SS9r	S\S'S\S'Sr147g)�AnnotationQueueiFzRepresents an annotation queue.rrYr r�Nr�r�c�J�[R"[R5$r[r\r$r-r.r_�AnnotationQueue.<lambda>Orar-rbrrdc�J�[R"[R5$r[r\r$r-r.r_r�Qrar-�148updated_atr�r$)r&r'r(r)r*r+r�rrdr�r,r$r-r.r�r�FsP��)��H�8�149
�I�+�!%�K��%�:� �1S�T�J��T�>� �1S�T�J��T�C��O�Dr-r�c�(�\rSrSr%SrSrS\S'Srg)�AnnotationQueueWithDetailsiWz,Represents an annotation queue with details.Nr��rubric_instructionsr$)r&r'r(r)r*r�r+r,r$r-r.r�r�Ws��6�)-���-�;r-r�c�`�\rSrSr%SrS\S'S\S'S\S'S\S'S\S	'S150\S'Srg
)�BatchIngestConfigi^z"Configuration for batch ingestion.rh�use_multipart_endpointrB�scale_up_qsize_trigger�scale_up_nthreads_limit�scale_down_nempty_trigger�151size_limitr��size_limit_bytesr$Nr%r$r-r.r�r�^s:��,� � �D���<� � �7�"�"�A��O�/�#�#�8r-r�c�X�\rSrSr%SrSrS\S'SrS\S'SrS	\S152'Sr	S\S'S
r153g)�
LangSmithInfoioz'Information about the LangSmith server.rr �versionNr��license_expiration_timezOptional[BatchIngestConfig]�batch_ingest_configrK�instance_flagsr$)r&r'r(r)r*r�r+r�r�r�r,r$r-r.r�r�os;��1��G�S��.�26��/�6�+�7;��4�;��/3�N�,�3r-r�c�L�\rSrSr%SrS\S'S\S'S\S'SrS	\S154'Srg)�LangSmithSettingsi~z"Settings for the LangSmith tenant.r rY�display_namerrdNr��
tenant_handler$)r&r'r(r)r*r+r�r,r$r-r.r�r�~s)��,��G����)���*�#'�M�=�'r-r�c�<�\rSrSr%SrS\S'S\S'S\S'S	rg155)�FeedbackIngestTokeni�z2Represents the schema for a feedback ingest token.rrYr r�r�156expires_atr$Nr%r$r-r.r�r��s��<��H�.�	�H�3���+r-r�c�<�\rSrSr%SrS\S'S\S'S\S'S	rg157)�RunEventi�zRun event schema.r r�zUnion[datetime, str]�timerKr�r$Nr%r$r-r.r�r��s���158
�I��159���$�$�,r-r�c�<�\rSrSr%SrS\S'S\S'S\S'Srg)	�TimeDeltaInputi�zTimedelta input schema.rB�days�hours�minutesr$Nr%r$r-r.r�r��s��!�160
�I���J��
�L�r-r�c�<�\rSrSr%SrS\S'S\S'S\S'Srg)	�DatasetDiffInfoi�z;Represents the difference information between two datasets.z161list[UUID]�examples_modified�examples_added�examples_removedr$Nr%r$r-r.r�r��s ��E�!�!�=���:� � �<r-r�c��\rSrSr%SrS\S'SrS\S'SrS\S'S\S	'S162\S'S163\S'S\S
'SrS\S'Sr	S\S'Sr164S\S'\SSj5rSr
g)�ComparativeExperimenti�z�Represents a comparative experiment.165 166This information summarizes evaluation results comparing167two or more models on a given dataset.168rrYNr�r�r�r�rrdr�r�rKr�r��experiments_inforc�^�URbSUR;a0$URS$r�r�r>s r.rN�ComparativeExperiment.metadata�r�r-r$r�)r&r'r(r)r*r+r�r�r�r�rr�rNr,r$r-r.r�r��s����	
�H�?��D�-��:�!%�K��%�@��O�G���D���J���J�&*�E�#�*�?�-1��*�1�\�/3�N�,�3�P�
�&��&r-r�c��\rSrSr%Sr\"SS9rS\S'S\S'S\S'S	\S169'S\S'S
rS\S'\	"S
SS9r170S\S'\	"S
SS9rS\S'Srg
)�PromptCommiti�z$Represents a Prompt with a manifest.T)�populate_by_namer �owner�repo�commit_hashr��manifestz171list[dict]�examplesNr�r�rQ)rJ�aliasr��hub_model_config�model_provider�hub_model_providerr$)
r&r'r(r)r*rrQr+r�rr�r�r,r$r-r.r�r��sr��.��t�4�L��J�0�172
�I�!���(���%����!%�K��%�=�',�T��'P��n�P�1�(-�d�BR�(S��
�S�/r-r�c���\rSrSr%SrS\S'S\S'S\S'SrS	\S173'SrS	\S'SrS	\S'Sr	S
\S'Sr174S\S'SrS\S'\"\
S9rS\S'SrS\S'SrS\S'SrS
\S'SrS
\S'Srg)�ListedPromptCommiti�z;Represents a listed prompt commit with associated metadata.rrYr r�r�NrXr�repo_id�	parent_idr�r�r�rdr�rbr��example_run_idsrr��
num_downloads�	num_views�parent_commit_hashr�r$)r&r'r(r)r*r+rr�r�r�rdr�rr�r�r�r�r�r�r,r$r-r.r�r��s���E��H�6��J�)�175
�I�3�"&�K��&�O�"�G�^�"�5� $�I�~�$�8�!%�K��%�*�%)�J�"�)�=�%)�J�"�)�B�,1�$�,G�O�)�G�H�#$�M�=�$�>� �I�}� �:�(,��
�,�1�!%�K��%�=r-r�c�@�\rSrSr%SrS\S'SrS\S'SrS\S'S\S	'S\S176'S\S'S\S
'S\S'S\S'S\S'SrS\S'Sr	S\S'S\S'S\S'S\S'S\S'S\S'Sr177S\S'SrS\S'S\S'SrS\S'Sr
S\S 'S!rg)"�Promptiz"Represents a Prompt with metadata.r �repo_handleNr�r��readmerYr�rrdr�rh�	is_public�is_archivedr�r��original_repo_id�upstream_repo_idr��	full_namerB�	num_likesr�r�r�liked_by_auth_user�last_commit_hash�num_commits�original_repo_full_name�upstream_repo_full_namer$)r&r'r(r)r*r+r�r�r�r�r�r�r�r�r,r$r-r.r�r�s���,���!�!%�K��%�(� �F�M� �#��G���N�,���*���-��O�'���)�178�O�.�&*��m�*�3�&*��m�*�3���0��N�<��N����"��N��)-���-�@�&*��m�*�&��� �-1��]�1�:�-1��]�1�:r-r�c�0�\rSrSr%SrS\S'S\S'Srg)	�ListPromptsResponseiPz A list of prompts with metadata.zlist[Prompt]�reposrBr�r$Nr%r$r-r.r�r�Ps��*�����J�&r-r�c�.�\rSrSrSrSrSrSrSrSr	g)	�PromptSortFieldiYz$Enum for sorting fields for prompts.r�r�r�r�r$N)179r&r'r(r)r*r�r�r�r�r,r$r-r.rrYs%��.�#�M���I���J���I�r-rc�4�\rSrSr%SrSrS\S'S\S'Srg	)180�	FileEntryifzA file with inline content.�filezLiteral['file']rRr r�r$NrXr$r-r.rrfs��%�"�D�/�"��
�L�r-rc�d�\rSrSr%SrSrS\S'S\S'SrS	\S181'SrS\S'Sr	S\S
'Sr182g)�183AgentEntryiozA link to another agent repo.�agentzLiteral['agent']rRr r�NrX�	commit_idr�r�r�r$�r&r'r(r)r*rRr+rr�r�r,r$r-r.rrosC��'�$�D�184�$����(� $�I�~�$�6��E�=��'�!%�K��%�-r-rc�d�\rSrSr%SrSrS\S'S\S'SrS	\S185'SrS\S'Sr	S\S
'Sr186g)�187SkillEntryi~zA link to a skill repo.�skillzLiteral['skill']rRr r�NrXrr�r�r�r$r	r$r-r.rr~sC��!�$�D�188�$����(� $�I�~�$�6��E�=��'�!%�K��%�-r-rrR)�
discriminatorc�<�\rSrSr%SrS\S'S\S'S\S'S	rg189)�AgentContexti�zAn agent pulled from hub.rrr r��dict[str, Entry]�filesr$Nr%r$r-r.rr�s��#��O�������!r-rc�<�\rSrSr%SrS\S'S\S'S\S'S	rg190)�SkillContexti�zA skill pulled from hub.rrr r�rrr$Nr%r$r-r.rr�s��"��O�������!r-rc�<�\rSrSr%SrS\S'S\S'S\S'S	rg191)�DirectoryCommitInfoi�z0Commit details returned from a directory commit.rrYr r�rrdr$Nr%r$r-r.rr�s��:��H�������&r-rc�$�\rSrSr%SrS\S'Srg)�DirectoryCommitResponsei�z0Response body for ``POST /directories/commits``.r�commitr$Nr%r$r-r.rr�s��:���r-rc�`�\rSrSr%SrS\S'S\S'S\S'S\S'S\S'S\S	'S192rg)�InputTokenDetailsi�zvBreakdown of input token counts.193 194Does *not* need to sum to full input token count. Does *not* need to have all keys.195rB�audio�cache_creation�196cache_read�cache_read_over_200k�ephemeral_5m_input_tokens�ephemeral_1h_input_tokensr$Nr%r$r-r.rr�sG���197�J������O�����"�"�S�"�"�Qr-rc�0�\rSrSr%SrS\S'S\S'Srg)�OutputTokenDetailsi�zxBreakdown of output token counts.198 199Does *not* need to sum to full output token count. Does *not* need to have all keys.200rBr�	reasoningr$Nr%r$r-r.r"r"�s���201�J���N�r-r"c�<�\rSrSr%SrS\S'S\S'S\S'Srg)	�InputCostDetailsi�znBreakdown of input token costs.202 203Does *not* need to sum to full input cost. Does *not* need to have all keys.204rprrrr$Nr%r$r-r.r%r%�s)���205�L�%������r-r%c�0�\rSrSr%SrS\S'S\S'Srg)�OutputCostDetailsi�zpBreakdown of output token costs.206 207Does *not* need to sum to full output cost. Does *not* need to have all keys.208rprr#r$Nr%r$r-r.r'r'�s���209�L�&���r-r'c��\rSrSr%SrS\S'S\S'S\S'S\S'S	\S210'S\S'S\S
'S\S'S\S'S\S'Srg)�
UsageMetadatai	z�Usage metadata for a message, such as token counts.211 212This is a standard representation of token usage that is consistent across models.213rBr#r&rzNotRequired[InputTokenDetails]r/zNotRequired[OutputTokenDetails]r2zNotRequired[float]r)r,r
zNotRequired[InputCostDetails]r5zNotRequired[OutputCostDetails]r8r$Nr%r$r-r.r)r)	sk���214��J���P���A�7�7��:�9��#�"�'�#�#�(�"�"�'�5�5�/�7�7�0r-r)c��\rSrSr%SrS\S'S\S'S\S'S\S'S	\S215'S\S'S\S
'S\S'S\S'S\S'Srg)�ExtractedUsageMetadatai+z�Usage metadata dictionary extracted from a run.216 217Should be the same as UsageMetadata, but does not require all218keys to be present.219rBr#r&rrr/r"r2rpr)r,r
r%r5r'r8r$Nr%r$r-r.r+r++sc�����3���3���*�*�*�*�,�,�+���'���(���'�(�(�/�*�*�0r-r+c�<�\rSrSr%SrS\S'S\S'S\S'S	rg220)�UpsertExamplesResponseiHzCResponse object returned from the upsert_examples_multipart method.rB�countr��example_idszNotRequired[str | None]r�r$Nr%r$r-r.r-r-Hs��M��J�4���5�"�"�cr-r-c�0�\rSrSr%Sr\"\S9rS\S'Sr	g)�ExampleWithRunsiSzExample with runs.rbz	list[Run]�runsr$N)221r&r'r(r)r*rr�r2r+r,r$r-r.r1r1Ss����D�1�D�)�1�"r-r1c���\rSrSr%SrS\S'S\S'S\S'S\S'S\S	'S\S222'S\S'S
\S'S\S'S\S'S\S'S\S'S\S'S\S'Srg)�ExperimentRunStatsi[z!Run statistics for an experiment.r�r�r�r�r�rrrr�r�r�r�rr
rrr�r�r�r�r$Nr%r$r-r.r4r4[s���+���,�$�$�?�$�$�6���=� � �D�$�$�H�+�+�8�.�.�-�!�!�M�"�"�G�&�&�C�(�(�G�(�(�>���)r-r4c�<�\rSrSr%SrS\S'S\S'S\S'S	rg223)�ExperimentResultsi|z�Results container for experiment data with stats and examples.224 225Breaking change in v0.4.32:226    The 'stats' field has been split into 'feedback_stats' and 'run_stats'.227r�rr4�	run_statszIterator[ExampleWithRuns]�examples_with_runsr$Nr%r$r-r.r6r6|s!�����1�!�!�6�1�1r-r6c��\rSrSr%SrS\S'S\S'S\S'SrS	\S228'S\S'S\S'S\S
'\SSj5rSSjr	Sr229g)�InsightsReporti�zHAn Insights Report created by the Insights Agent over a tracing project.�230UUID | strrYr r�rN�231str | Noner��232project_id�host_urlr�c	��URS[UR5S[UR5S[UR53$)z1URL to view this Insights Report in LangSmith UI.r�r�z?tab=4&clusterJobId=)r>r r�r=rYr>s r.�link�InsightsReport.link�sH���-�-���C����$7�#8��S����EY�DZ�Zn�or�sw�sz�sz�o{�n|�}�}r-c�<�SURSURS3$)Nz	<a href="z2", target="_blank" rel="noopener">InsightsReport('z')</a>)r@r�r>s r.�_repr_html_�InsightsReport._repr_html_�s%���4�9�9�+�%X�Y]�Yb�Yb�Xc�cj�k�kr-r$r�)r&r'r(r)r*r+r�r�r@rCr,r$r-r.r:r:�sI��R��N�233
�I��K��E�:�����M���
�~��~�lr-r:c�b�\rSrSr%SrS\S'SrS\S'SrS\S	'S234\S'S\S
'SrS\S'Sr	g)�InsightsHighlightedTracei�z2A trace highlighted in an insights report summary.r;rbN�UUID | str | None�235cluster_idr<�cluster_namerB�rankr �highlight_reason�summaryr$)236r&r'r(r)r*r+rHrIrLr,r$r-r.rFrF�s5��<���$(�J�!�(�#�L�*�#�237
�I����G�Z�r-rFc�b�\rSrSr%Sr\"\S9rS\S'Sr	S\S'\"\S9r238S	\S239'SrS\S'S
rg)�InsightsSummaryReporti�zIHigh-level summary of an insights job: key points and highlighted traces.rbr��240key_pointsNr<�titlezlist[InsightsHighlightedTrace]�highlighted_traceszdatetime | Nonerdr$)
r&r'r(r)r*rr�rOr+rPrQrdr,r$r-r.rNrN�s9��S�!�$�7�J�	�7��E�:��9>�t�9T��6�T�"&�J��&r-rNc�v�\rSrSr%SrS\S'SrS\S'S\S	'S241\S'S242\S'SrS
\S'S\S'SrS\S'Sr	g)�InsightsClusteri�z/A single cluster of runs in an insights report.r;rYNrGr�rB�levelr r�r�r<�parent_name�num_runs�dict[str, Any] | None�statsr$)243r&r'r(r)r*r+r�rUrXr,r$r-r.rSrS�s?��9��N�#'�I� �'��J�244
�I���"�K��"��M�#'�E� �'r-rS)rHc�x�SSKJn /nSnSnUb�XgS.nUb[U5US'URSSUS	US2453US9n	UR	U	5 U	R5n246U247R
S/5=(d /nURU5 U248R
S
5nUcSnO[U5nU(dSnUbM�U$)zHFetch runs for an Insights job, optionally filtered to a single cluster.r)�utils�dN)�limitr9rH�GETz249/sessions/z250/insights/z/runs)�paramsr2r9)	�	langsmithrZr �request_with_retries�raise_for_status_with_text�jsonr��extendrB)
�clientr��job_idrH�ls_utils�all_runsr\�next_offsetr^�resp�body�batch�returned_offsets
             r.�_fetch_insights_runsrm�s���,�%'�H��E��K�251�252!�+0�!H���!�#&�z�?�F�<� ��*�*�����J�v�h�e�<��+�253��254	�+�+�D�1��y�y�{�������$�*���������(�(�8�,���"��K��o�.�K��"��)�255!�*�Or-c�N�\rSrSrSrSrS256SjrSSjrSSjrS
Sjr	SSjr257Srg	)�_ClusterWithTracesi�zYCluster wrapper that can load its traces from the API. Returned by report.clusters[name].��_cluster�_reportc��XlX lgr[rp)r3�cluster�reports   r.rq�_ClusterWithTraces.__init__�s���
��r-c�.�[URU5$r[)�getattrrq)r3r�s  r.�__getattr__�_ClusterWithTraces.__getattr__�s���t�}�}�d�+�+r-c��[[[UR55[[UR55-5$r[)r��set�dirrsrqr>s r.�__dir__�_ClusterWithTraces.__dir__�s.���C��D�N�N�+�,�s�3�t�}�}�3E�/F�F�G�Gr-c�8�SURR<S3$)Nz_ClusterWithTraces(name=�))rqr�r>s r.r��_ClusterWithTraces.__repr__�s��)�$�-�-�*<�*<�)?�q�A�Ar-c�258�[URSS5nUc[S5e[URSS5n[URSS5nUbUc[S5e[UUUURR259S9$)z.Fetch run dicts for this cluster from the API.�_clientNzMReport not attached to a client; get reports via Client.get_insights_report()�_session_id�_job_idzReport missing session/job ids)rdr�rerH)rxrr�260ValueErrorrmrqrY�r3rdr�res    r.�load_traces�_ClusterWithTraces.load_traces�s�������y�$�7���>��_��
��T�\�\�=�$�?�261�����y�$�7�������=�>�>�#��!���}�}�'�'�	262�	263r-N)rtrSru�InsightsReportResultrCr�)r�r rCrr�r�)rC�list[dict[str, Any]])r&r'r(r)r*�	__slots__rqryr~r�r�r,r$r-r.roro�s%��c�'�I��,�H�B�264r-roc�V�\rSrSrSrSrS265SjrSSjrSrSSjr	S
Sjr266Srg	)�_ClustersMapi267zWList-like map of clusters by name. Supports report.clusters['name'] and .load_traces().)�	_clustersrrc�0�[U5UlX lgr[)r�r�rr)r3�clustersrus   r.rq�_ClustersMap.__init__s��268�h�����r-c	�0�[U[5(aURUnOXURVs0sHo3RU_M nnX;a)[	SU<S[UR
5535eXAn[X R5$s snf)NzCluster z not found; available: )	�269isinstancerBr�r��KeyErrorr��keysrorr)r3rcrt�c�by_names     r.�__getitem__�_ClustersMap.__getitem__s����c�3����n�n�S�)�G�*.�.�.�9�.�Q�v�v�q�y�.�G�9��!���s�g�%<�T�'�,�,�.�=Q�<R�S����l�G�!�'�<�<�8�8��
:s�Bc�0^�U4SjTR5$)Nc3�P># �UHn[UTR5v� M g7fr[)rorr)�.0r�r3s  �r.�	<genexpr>�(_ClustersMap.__iter__.<locals>.<genexpr>$s ����L�^��"�1�d�l�l�3�3�^�s�#&)r�r>s`r.�__iter__�_ClustersMap.__iter__#s���L�T�^�^�L�Lr-c�,�[UR5$r[��lenr�r>s r.�__len__�_ClustersMap.__len__&s���4�>�>�"�"r-c�4�S[UR5S3$)Nz_ClustersMap(n_clusters=r�r�r>s r.r��_ClustersMap.__repr__)s��)�#�d�n�n�*=�)>�a�@�@r-N)r��list[InsightsCluster]rur�rCr�)rcz	str | intrCro)rCrBr�)r&r'r(r)r*r�rqr�r�r�r�r,r$r-r.r�r�270sA��a�(�I��'��%��271�	�2729�M�#�Ar-r�c�R�\rSrSr%SrS\S'S\S'S\S'SrS	\S273'SrS	\S'SrS	\S'Sr	S
\S'Sr274S\S'SrS\S'SrS\S'\
"\S9rS\S'SrS\S'\
"\S9rS\S'\"SS9rS\S'\"SS9rS\S'\"SS9rS\S '\"S!S"9rS'S#jrS(S$jrS(S%jrS&rg))r�i-zVFull result of fetching an Insights report (job + clusters + summary + optional runs).r;rYr r�rNzdatetime | str | Noner�r�rdrWrNr;�shaper<r�rG�	config_idrbr�r�zInsightsSummaryReport | Nonerur�r2rIrr�r�r��allowr�c��[RUSU5 [RUS[U55 [RUS[U55 [RUS[URU55 g)zXAttach client and ids so clusters can load traces. Called by Client.get_insights_report.r�r�r�r�N)�object�__setattr__r r�r�r�s    r.�_attach_client�#InsightsReportResult._attach_clientEsd��	���4��F�3����4���J��@����4��C��K�8�����������-�	275r-c�L�URn[US5(a![RUSUR5 URSS9[US5(a[RUSU5 $$![US5(a[RUSU5 ff=f)z?Return the report as a JSON-serializable dict (raw JSON shape).r�r�rb��mode)r��hasattrr�r�r��276model_dump)r3�clusters_vals  r.�to_json�InsightsReportResult.to_jsonUs����}�}���<��-�-����t�Z��1G�1G�H�	C��?�?��?�/��|�[�1�1��"�"�4��\�B�2��w�|�[�1�1��"�"�4��\�B�2�s�A8�8+B#c� �URSS9$)zHReturn the report as a JSON-serializable dict (e.g. for saving to file).rbr�)r�r>s r.�model_dump_json_dict�)InsightsReportResult.model_dump_json_dict`s�����F��+�+r-r$)rdrr��277str | UUIDrer�rCr�r�)r&r'r(r)r*r+r�r�rdrNr�r�r�rr�r�rur2rr�r�r�rrQr�r�r�r,r$r-r.r�r�-s���`��N�278
�I��K�(,�J�%�,�&*�H�#�*�(,�J�%�,�&*�H�#�*�#'�E� �'��E�:��#'�I� �'�&+�D�&A�H�#�A�+/�F�(�/�!&�t�!<�D�279�<�8��t�,�G�S�,�"�4�0�K��0��t�,�G�S�,��G�,�L�280��281��282��	283�284285�286� 	C�,r-r�c�8�\rSrSr%SrS\S'S\S'S\S'S	rg287)�FeedbackFormulaWeightedVariableiezBA feedback key and weight used when calculating feedback formulas.zLiteral['weighted_key']�	part_typerp�weightz#Annotated[str, Field(min_length=1)]rcr$Nr%r$r-r.r�r�es��L�&�&��M�	,�,r-r�c�d�\rSrSr%SrSrS\S'SrS\S'S\S'S	\S288'\"SSS
S9r	S\S'Sr289g)�FeedbackFormulaCreateimz,Schema used for creating a feedback formula.NrXrHr�r r��Literal['sum', 'avg']�aggregation_type.��2��290min_length�291max_length�%list[FeedbackFormulaWeightedVariable]�
formula_partsr$)r&r'r(r)r*rHr+r�rr�r,r$r-r.r�r�ms>��6�!%�J��%�!%�J��%���+�+�;@���b�<�M�8�r-r�c�H�\rSrSr%SrS\S'S\S'\"SSS	S2929rS\S'S
rg)�FeedbackFormulaUpdateiyz,Schema used for updating a feedback formula.r r�r�r�.r�r�r�r�r�r$N)	r&r'r(r)r*r+rr�r,r$r-r.r�r�ys*��6���+�+�;@���b�<�M�8�r-r�c�8�\rSrSr%SrS\S'S\S'S\S'Srg	)293�FeedbackFormulai�z%Schema for getting feedback formulas.rrYrrdr�r$Nr%r$r-r.r�r��s��/��H����r-r�c�X�\rSrSr%SrS\S'S\S'S\S'S	\S294'SrS\S
'Srg)�FeedbackConfigSchemai�z�Represents a feedback configuration for a tenant's feedback key.295 296Feedback configurations define how feedback with a given key should be297interpreted, including its type (continuous, categorical, or freeform),298scoring bounds, and valid categories.299r r�rsryrr�rr�Nr�is_lower_score_betterr$)r&r'r(r)r*r+r�r,r$r-r.r�r��s:�����A�#�#�H��O�E���=�,0��>�0�Kr-r�)300rdrr�r�rer�rHzstr | UUID | NonerCr�)�r*�301__future__r�collections.abcrrrr�decimalr�enumr	�pathlibr302�typingrrr
rrrr�uuidr�pydanticrrrrrrr�typing_extensionsrrrrdr�r rfr�tuplerDrKr0rFrS�_AttachmentLikerV�ExampleUploadWithAttachmentsryr|r�r�r��ExampleUpdateWithAttachmentsr�r��DatasetTransformationTyper�r�r�r�r�r�r=rErMrQrVrZr]rarorsrxr{r}r�r�r�r�r�r�r�r��
model_rebuildr�r�r�r�r�r�r�r�r�r�rrrr�Entryrrrrrr"r%r'r)r+r-r1r4r6r:rFrNrSrmror�r�r�r�r�r�r�r$r-r.�<module>r�st��$�"�$�2�2�����������>�=�
�:�y�+�t�;�
<�303�
�4��j�)�[�$�F�
G�304����*�3��e�C��J�/��U�3��9�=M�M�N�N�O����
�8�
��
� I�)�I��i��305����s�E�z�!2�E�#�t�)�4D�D���306!�I�!�& -���=���Y��'b�k�'b�T�I��!�I�!�& -���s�D��+�)�+�$����?�I�U�?�-�k�-�`�Y���T<�i�T<�nC,�'�C,�L	�#�t�	��)�5��:4��4�=��=�"!�*�!�%�,�%�#��#�&+�9�&+�RO�y��O�@�Y�e�@�!�\�!�	3�|�	3�3"�I�3"�l%*�-�%*�P�307;�h�308;��309;�)��%�)�O�	��O�$E�i�E�"<��<�9�	��9�"	4�I�	4�����	(�	�	(�,�)�,�-�y��-��Y�e��=�i�=�!&�I�!&�H0�9�0�.+>��+>�\.;�Y�.;�b'�)�'�310�c�4�311��	��.��.�.��.�	�%�	�:�z�9�:�E�PV�<W�W�X��5�"�9�"�"�9�"�'�)�'��i��R�	��R�6
��%�
� �y���*
�	��
� 1�I�1�D1�Y�e�1�:d�Y�d�#�g�#�*��*�B2�	�2�l�Y�l�(�y��'�I�'�312(�i�313(�$%)�"��"��"�
�"�314"�"��
"�J#315�#316�L A� A�F5,�9�5,�p-�i�-�	�I�	��I���+��L�9�Lr-
codekingpro/portable-devtools · Team Ai