docent-python 0.1.14a0__py3-none-any.whl → 0.1.28a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of docent-python might be problematic. Click here for more details.
- docent/_llm_util/__init__.py +0 -0
- docent/_llm_util/data_models/__init__.py +0 -0
- docent/_llm_util/data_models/exceptions.py +48 -0
- docent/_llm_util/data_models/llm_output.py +331 -0
- docent/_llm_util/llm_cache.py +193 -0
- docent/_llm_util/llm_svc.py +472 -0
- docent/_llm_util/model_registry.py +130 -0
- docent/_llm_util/providers/__init__.py +0 -0
- docent/_llm_util/providers/anthropic.py +537 -0
- docent/_llm_util/providers/common.py +41 -0
- docent/_llm_util/providers/google.py +530 -0
- docent/_llm_util/providers/openai.py +745 -0
- docent/_llm_util/providers/openrouter.py +375 -0
- docent/_llm_util/providers/preference_types.py +104 -0
- docent/_llm_util/providers/provider_registry.py +164 -0
- docent/data_models/__init__.py +2 -0
- docent/data_models/agent_run.py +17 -29
- docent/data_models/chat/__init__.py +6 -1
- docent/data_models/chat/message.py +3 -1
- docent/data_models/citation.py +103 -22
- docent/data_models/judge.py +19 -0
- docent/data_models/metadata_util.py +16 -0
- docent/data_models/remove_invalid_citation_ranges.py +23 -10
- docent/data_models/transcript.py +25 -80
- docent/data_models/util.py +170 -0
- docent/judges/__init__.py +23 -0
- docent/judges/analysis.py +77 -0
- docent/judges/impl.py +587 -0
- docent/judges/runner.py +129 -0
- docent/judges/stats.py +205 -0
- docent/judges/types.py +311 -0
- docent/judges/util/forgiving_json.py +108 -0
- docent/judges/util/meta_schema.json +86 -0
- docent/judges/util/meta_schema.py +29 -0
- docent/judges/util/parse_output.py +87 -0
- docent/judges/util/voting.py +139 -0
- docent/sdk/agent_run_writer.py +72 -21
- docent/sdk/client.py +276 -23
- docent/trace.py +413 -90
- {docent_python-0.1.14a0.dist-info → docent_python-0.1.28a0.dist-info}/METADATA +13 -5
- docent_python-0.1.28a0.dist-info/RECORD +59 -0
- docent/data_models/metadata.py +0 -229
- docent/data_models/yaml_util.py +0 -12
- docent_python-0.1.14a0.dist-info/RECORD +0 -32
- {docent_python-0.1.14a0.dist-info → docent_python-0.1.28a0.dist-info}/WHEEL +0 -0
- {docent_python-0.1.14a0.dist-info → docent_python-0.1.28a0.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docent-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.28a0
|
|
4
4
|
Summary: Docent SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/TransluceAI/docent
|
|
6
6
|
Project-URL: Issues, https://github.com/TransluceAI/docent/issues
|
|
@@ -9,15 +9,23 @@ Author-email: Transluce <info@transluce.org>
|
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE.md
|
|
11
11
|
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: anthropic>=0.47.0
|
|
13
|
+
Requires-Dist: backoff>=2.2.1
|
|
14
|
+
Requires-Dist: google-genai>=1.16.1
|
|
15
|
+
Requires-Dist: inspect-ai>=0.3.132
|
|
16
|
+
Requires-Dist: jsonschema>=4.24.0
|
|
17
|
+
Requires-Dist: openai>=1.68.0
|
|
12
18
|
Requires-Dist: opentelemetry-api>=1.34.1
|
|
13
19
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.34.1
|
|
14
20
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.34.1
|
|
15
|
-
Requires-Dist: opentelemetry-instrumentation-anthropic>=0.
|
|
16
|
-
Requires-Dist: opentelemetry-instrumentation-bedrock>=0.
|
|
17
|
-
Requires-Dist: opentelemetry-instrumentation-
|
|
18
|
-
Requires-Dist: opentelemetry-instrumentation-
|
|
21
|
+
Requires-Dist: opentelemetry-instrumentation-anthropic>=0.40.14
|
|
22
|
+
Requires-Dist: opentelemetry-instrumentation-bedrock>=0.40.14
|
|
23
|
+
Requires-Dist: opentelemetry-instrumentation-google-generativeai>=0.40.14
|
|
24
|
+
Requires-Dist: opentelemetry-instrumentation-langchain>=0.40.14
|
|
25
|
+
Requires-Dist: opentelemetry-instrumentation-openai>=0.40.14
|
|
19
26
|
Requires-Dist: opentelemetry-instrumentation-threading>=0.55b1
|
|
20
27
|
Requires-Dist: opentelemetry-sdk>=1.34.1
|
|
28
|
+
Requires-Dist: orjson>=3.11.3
|
|
21
29
|
Requires-Dist: pydantic>=2.11.7
|
|
22
30
|
Requires-Dist: pyyaml>=6.0.2
|
|
23
31
|
Requires-Dist: tiktoken>=0.7.0
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
docent/__init__.py,sha256=fuhETwJPcesiB76Zxa64HBJxeaaTyRalIH-fs77TWsU,112
|
|
2
|
+
docent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
docent/trace.py,sha256=J05K9MykKGkeBjh9idTOPtiMA5_h0AdL8zRR-yKu5Yg,79525
|
|
4
|
+
docent/trace_temp.py,sha256=Z0lAPwVzXjFvxpiU-CuvfWIslq9Q4alNkZMoQ77Xudk,40711
|
|
5
|
+
docent/_llm_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
docent/_llm_util/llm_cache.py,sha256=nGrvfFikFbEnfmzZRvWvZ60gfVSTvW1iC8-ciCXwbAk,6430
|
|
7
|
+
docent/_llm_util/llm_svc.py,sha256=LqrI8DdhqOmkcz3tsyzSlhrJv2gA4-0DE105WLys6sw,18156
|
|
8
|
+
docent/_llm_util/model_registry.py,sha256=CdOi4g3eZCBQjLQDNQtprXpby0Ldc6AIRvLAD6Ajc90,3502
|
|
9
|
+
docent/_llm_util/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
docent/_llm_util/data_models/exceptions.py,sha256=IW4BVMVp8r5TufNXyrhy3acgwJiQQQPQjB9VA4RVXw8,1489
|
|
11
|
+
docent/_llm_util/data_models/llm_output.py,sha256=UCYewoXN72skigN_fm414TzQol1KxmVbQGwgGVROE_4,10602
|
|
12
|
+
docent/_llm_util/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
docent/_llm_util/providers/anthropic.py,sha256=M5ryu_lGKZ3PDJLSCV07zsiAvEeAyEgZ13rbzOeutS8,18765
|
|
14
|
+
docent/_llm_util/providers/common.py,sha256=dgcTuU4XkCKoAaM48UW8zMgRYUzj7TDBhvWqtnxBO7g,1166
|
|
15
|
+
docent/_llm_util/providers/google.py,sha256=2D9mDgenZW0pt0_V7koX-aoZzpl8jo8xE5EWOLK7I0k,20314
|
|
16
|
+
docent/_llm_util/providers/openai.py,sha256=4niQV9CNaJ-iiEwYG0BSFxCwcsCAWZz0JuUs4wBKu9M,25904
|
|
17
|
+
docent/_llm_util/providers/openrouter.py,sha256=sT2onpeQ1gAwJLjkQbzD2RodJWTm013Q-siTXezca10,11958
|
|
18
|
+
docent/_llm_util/providers/preference_types.py,sha256=K1IH15YyU8E8F7Jk7LgLKiCJeDNk9uASTdnZGk5hSDc,3773
|
|
19
|
+
docent/_llm_util/providers/provider_registry.py,sha256=EPYGQlegYPtg4ogEusCftm_5PZP-_XVKH1qg3xjPFTU,6337
|
|
20
|
+
docent/_log_util/__init__.py,sha256=3HXXrxrSm8PxwG4llotrCnSnp7GuroK1FNHsdg6f7aE,73
|
|
21
|
+
docent/_log_util/logger.py,sha256=kwM0yRW1IJd6-XTorjWn48B4l8qvD2ZM6VDjY5eskQI,4422
|
|
22
|
+
docent/data_models/__init__.py,sha256=vEcFppE6wtKFp37KF_hUv00Ncn6fK_qUbVGZE5ltz-o,383
|
|
23
|
+
docent/data_models/_tiktoken_util.py,sha256=hC0EDDWItv5-0cONBnHWgZtQOflDU7ZNEhXPFo4DvPc,3057
|
|
24
|
+
docent/data_models/agent_run.py,sha256=D9KVGVChm2q4B_cruVYtQH-5Xk31ZxTYhoZn6RGrc_o,19392
|
|
25
|
+
docent/data_models/citation.py,sha256=2_M1-_olVOJtjCGGFx1GIwGYWl0ILHxRsW8-EFDS9j0,7844
|
|
26
|
+
docent/data_models/judge.py,sha256=BOKAfZmNoLPclJNz_b7NvH8G8FzfR7kc6OpIv91GMDQ,336
|
|
27
|
+
docent/data_models/metadata_util.py,sha256=E-EClAP5vVm9xbfTlPSz0tUyCalOfN9Jujd6JGoRnBg,487
|
|
28
|
+
docent/data_models/regex.py,sha256=0ciIerkrNwb91bY5mTcyO5nDWH67xx2tZYObV52fmBo,1684
|
|
29
|
+
docent/data_models/remove_invalid_citation_ranges.py,sha256=3RSMsOzFO2cSjkxI549TAo12qdvD-AGHd05Jxu0amvs,6282
|
|
30
|
+
docent/data_models/shared_types.py,sha256=jjm-Dh5S6v7UKInW7SEqoziOsx6Z7Uu4e3VzgCbTWvc,225
|
|
31
|
+
docent/data_models/transcript.py,sha256=Hkj9-rQfRk6ywICpwM4P1vgpTJ_7T3jxjFtodfFcwPw,20087
|
|
32
|
+
docent/data_models/util.py,sha256=dK0dviDkDe8PiNCZisryctT-dzScWenLXQi6DOk9Ts4,7194
|
|
33
|
+
docent/data_models/chat/__init__.py,sha256=ws77P3raDiOv6XesAMycUwu-uT75D5f9aNgjFeJbUH8,631
|
|
34
|
+
docent/data_models/chat/content.py,sha256=Co-jO8frQa_DSP11wJuhPX0s-GpJk8yqtKqPeiAIZ_U,1672
|
|
35
|
+
docent/data_models/chat/message.py,sha256=_72xeTdgv8ogQd4WLl1P3yXfIDkIEQrHlWgdvObeQxY,4291
|
|
36
|
+
docent/data_models/chat/tool.py,sha256=MMglNHzkwHqUoK0xDWqs2FtelPsgHqwVpGpI1F8KZyw,3049
|
|
37
|
+
docent/judges/__init__.py,sha256=aTsQ2mIQnZt8HEMau02KrEA4m5w-lGC3U9Dirkj3to4,500
|
|
38
|
+
docent/judges/analysis.py,sha256=bn7XIT7mj77LjFHMh1PqjALknq3nN-fRXqgg8cfJF8o,2486
|
|
39
|
+
docent/judges/impl.py,sha256=JOq2tEBTqNbWIG2gRuI8OmEW2dHdx7nfnJnHeGwdyOk,24035
|
|
40
|
+
docent/judges/runner.py,sha256=k1OyEPEhAUiRiJpOAwbaAqsPHsKfseD7URXGqhVI974,4496
|
|
41
|
+
docent/judges/stats.py,sha256=zejJle583xHG2G3gcYHiWcHoIOkeKwpSkl8lfeKQhFs,7805
|
|
42
|
+
docent/judges/types.py,sha256=goNaKs3PF5wMHWLnFerYCEjUjPR0IVI9cVrxCK2TfjI,11539
|
|
43
|
+
docent/judges/util/forgiving_json.py,sha256=zSh0LF3UVHdSjuMNvEiqUmSxpxPaqK1rSLiI6KCNihg,3549
|
|
44
|
+
docent/judges/util/meta_schema.json,sha256=7VHCGQUM0PbMIiwWDar15Sqaodi2y2Ty7yIW3PDL268,2105
|
|
45
|
+
docent/judges/util/meta_schema.py,sha256=6IrIRHERJ6tkRcUtUShJ84I68yUJgkwfFeBjgt42qEA,930
|
|
46
|
+
docent/judges/util/parse_output.py,sha256=XMdU-hd3iozlGa72bpTrOADRpRze2sg68RSkQAw-yD4,2975
|
|
47
|
+
docent/judges/util/voting.py,sha256=IRYXXYLsdc8MsgdzBBNVI1nnsx4kxnnWLPeQyLrDhwc,5152
|
|
48
|
+
docent/loaders/load_inspect.py,sha256=VLrtpvcVZ44n2DIPMwUivXqbvOWjaooGw6moY8UQ0VE,6789
|
|
49
|
+
docent/samples/__init__.py,sha256=roDFnU6515l9Q8v17Es_SpWyY9jbm5d6X9lV01V0MZo,143
|
|
50
|
+
docent/samples/load.py,sha256=ZGE07r83GBNO4A0QBh5aQ18WAu3mTWA1vxUoHd90nrM,207
|
|
51
|
+
docent/samples/log.eval,sha256=orrW__9WBfANq7NwKsPSq9oTsQRcG6KohG5tMr_X_XY,397708
|
|
52
|
+
docent/samples/tb_airline.json,sha256=eR2jFFRtOw06xqbEglh6-dPewjifOk-cuxJq67Dtu5I,47028
|
|
53
|
+
docent/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
|
+
docent/sdk/agent_run_writer.py,sha256=0AWdxejoqZyuj9JSA39WlEwGcMSYTWNqnzIuluySY-M,11043
|
|
55
|
+
docent/sdk/client.py,sha256=BeW9nMlCVOyLN8o7S81ePX0ngFrmzJHMxa8YbundKgs,24321
|
|
56
|
+
docent_python-0.1.28a0.dist-info/METADATA,sha256=7uIPnlYJFyZpE6xCEXwz4OlGD-_br4B4GY6DZ0uj7i8,1351
|
|
57
|
+
docent_python-0.1.28a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
58
|
+
docent_python-0.1.28a0.dist-info/licenses/LICENSE.md,sha256=QIMv2UiT6MppRasso4ymaA0w7ltkqmlL0HCt8CLD7Rc,580
|
|
59
|
+
docent_python-0.1.28a0.dist-info/RECORD,,
|
docent/data_models/metadata.py
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
# import traceback
|
|
2
|
-
# from typing import Any, Optional
|
|
3
|
-
|
|
4
|
-
# from pydantic import (
|
|
5
|
-
# BaseModel,
|
|
6
|
-
# ConfigDict,
|
|
7
|
-
# Field,
|
|
8
|
-
# PrivateAttr,
|
|
9
|
-
# SerializerFunctionWrapHandler,
|
|
10
|
-
# model_serializer,
|
|
11
|
-
# model_validator,
|
|
12
|
-
# )
|
|
13
|
-
|
|
14
|
-
# from docent._log_util import get_logger
|
|
15
|
-
|
|
16
|
-
# logger = get_logger(__name__)
|
|
17
|
-
|
|
18
|
-
# SINGLETONS = (int, float, str, bool)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# class BaseMetadata(BaseModel):
|
|
22
|
-
# """Provides common functionality for accessing and validating metadata fields.
|
|
23
|
-
# All metadata classes should inherit from this class.
|
|
24
|
-
|
|
25
|
-
# Serialization Behavior:
|
|
26
|
-
# - Field descriptions are highly recommended and stored in serialized versions of the object.
|
|
27
|
-
# - When a subclass of BaseMetadata is uploaded to a server, all extra fields and their descriptions are retained.
|
|
28
|
-
# - To recover the original structure with proper typing upon download, use:
|
|
29
|
-
# `CustomMetadataClass.model_validate(obj.model_dump())`.
|
|
30
|
-
|
|
31
|
-
# Attributes:
|
|
32
|
-
# model_config: Pydantic configuration that allows extra fields.
|
|
33
|
-
# allow_fields_without_descriptions: Boolean indicating whether to allow fields without descriptions.
|
|
34
|
-
# """
|
|
35
|
-
|
|
36
|
-
# model_config = ConfigDict(extra="allow")
|
|
37
|
-
# allow_fields_without_descriptions: bool = True
|
|
38
|
-
|
|
39
|
-
# # Private attribute to store field descriptions
|
|
40
|
-
# _field_descriptions: dict[str, str | None] | None = PrivateAttr(default=None)
|
|
41
|
-
# _internal_basemetadata_fields: set[str] = PrivateAttr(
|
|
42
|
-
# default={
|
|
43
|
-
# "allow_fields_without_descriptions",
|
|
44
|
-
# "model_config",
|
|
45
|
-
# "_field_descriptions",
|
|
46
|
-
# }
|
|
47
|
-
# )
|
|
48
|
-
|
|
49
|
-
# @model_validator(mode="after")
|
|
50
|
-
# def _validate_field_types_and_descriptions(self):
|
|
51
|
-
# """Validates that all fields have descriptions and proper types.
|
|
52
|
-
|
|
53
|
-
# Returns:
|
|
54
|
-
# Self: The validated model instance.
|
|
55
|
-
|
|
56
|
-
# Raises:
|
|
57
|
-
# ValueError: If any field is missing a description or has an invalid type.
|
|
58
|
-
# """
|
|
59
|
-
# # Validate each field in the model
|
|
60
|
-
# for field_name, field_info in self.__class__.model_fields.items():
|
|
61
|
-
# if field_name in self._internal_basemetadata_fields:
|
|
62
|
-
# continue
|
|
63
|
-
|
|
64
|
-
# # Check that field has a description
|
|
65
|
-
# if field_info.description is None:
|
|
66
|
-
# if not self.allow_fields_without_descriptions:
|
|
67
|
-
# raise ValueError(
|
|
68
|
-
# f"Field `{field_name}` needs a description in the definition of `{self.__class__.__name__}`, like `{field_name}: T = Field(description=..., default=...)`. "
|
|
69
|
-
# "To allow un-described fields, set `allow_fields_without_descriptions = True` on the instance or in your metadata class definition."
|
|
70
|
-
# )
|
|
71
|
-
|
|
72
|
-
# # Validate that the metadata is JSON serializable
|
|
73
|
-
# try:
|
|
74
|
-
# self.model_dump_json()
|
|
75
|
-
# except Exception as e:
|
|
76
|
-
# raise ValueError(
|
|
77
|
-
# f"Metadata is not JSON serializable: {e}. Traceback: {traceback.format_exc()}"
|
|
78
|
-
# )
|
|
79
|
-
|
|
80
|
-
# return self
|
|
81
|
-
|
|
82
|
-
# def model_post_init(self, __context: Any) -> None:
|
|
83
|
-
# """Initializes field descriptions from extra data after model initialization.
|
|
84
|
-
|
|
85
|
-
# Args:
|
|
86
|
-
# __context: The context provided by Pydantic's post-initialization hook.
|
|
87
|
-
# """
|
|
88
|
-
# fd = self.model_extra.pop("_field_descriptions", None) if self.model_extra else None
|
|
89
|
-
# if fd is not None:
|
|
90
|
-
# self._field_descriptions = fd
|
|
91
|
-
|
|
92
|
-
# @model_serializer(mode="wrap")
|
|
93
|
-
# def _serialize_model(self, handler: SerializerFunctionWrapHandler):
|
|
94
|
-
# # Call the default serializer
|
|
95
|
-
# data = handler(self)
|
|
96
|
-
|
|
97
|
-
# # Dump the field descriptions
|
|
98
|
-
# if self._field_descriptions is None:
|
|
99
|
-
# self._field_descriptions = self._compute_field_descriptions()
|
|
100
|
-
# data["_field_descriptions"] = self._field_descriptions
|
|
101
|
-
|
|
102
|
-
# return data
|
|
103
|
-
|
|
104
|
-
# def model_dump(
|
|
105
|
-
# self, *args: Any, strip_internal_fields: bool = False, **kwargs: Any
|
|
106
|
-
# ) -> dict[str, Any]:
|
|
107
|
-
# data = super().model_dump(*args, **kwargs)
|
|
108
|
-
|
|
109
|
-
# # Remove internal fields if requested
|
|
110
|
-
# if strip_internal_fields:
|
|
111
|
-
# for field in self._internal_basemetadata_fields:
|
|
112
|
-
# if field in data:
|
|
113
|
-
# data.pop(field)
|
|
114
|
-
|
|
115
|
-
# return data
|
|
116
|
-
|
|
117
|
-
# def get(self, key: str, default_value: Any = None) -> Any:
|
|
118
|
-
# """Gets a value from the metadata by key.
|
|
119
|
-
|
|
120
|
-
# Args:
|
|
121
|
-
# key: The key to look up in the metadata.
|
|
122
|
-
# default_value: Value to return if the key is not found. Defaults to None.
|
|
123
|
-
|
|
124
|
-
# Returns:
|
|
125
|
-
# Any: The value associated with the key, or the default value if not found.
|
|
126
|
-
# """
|
|
127
|
-
# # Check if the field exists in the model's fields
|
|
128
|
-
# if key in self.__class__.model_fields or (
|
|
129
|
-
# self.model_extra is not None and key in self.model_extra
|
|
130
|
-
# ):
|
|
131
|
-
# # Field exists, return its value (even if None)
|
|
132
|
-
# return getattr(self, key)
|
|
133
|
-
|
|
134
|
-
# logger.warning(f"Field '{key}' not found in {self.__class__.__name__}")
|
|
135
|
-
# return default_value
|
|
136
|
-
|
|
137
|
-
# def get_field_description(self, field_name: str) -> str | None:
|
|
138
|
-
# """Gets the description of a field defined in the model schema.
|
|
139
|
-
|
|
140
|
-
# Args:
|
|
141
|
-
# field_name: The name of the field.
|
|
142
|
-
|
|
143
|
-
# Returns:
|
|
144
|
-
# str or None: The description string if the field is defined in the model schema
|
|
145
|
-
# and has a description, otherwise None.
|
|
146
|
-
# """
|
|
147
|
-
# if self._field_descriptions is None:
|
|
148
|
-
# self._field_descriptions = self._compute_field_descriptions()
|
|
149
|
-
|
|
150
|
-
# if field_name in self._field_descriptions:
|
|
151
|
-
# return self._field_descriptions[field_name]
|
|
152
|
-
|
|
153
|
-
# logger.warning(
|
|
154
|
-
# f"Field description for '{field_name}' not found in {self.__class__.__name__}"
|
|
155
|
-
# )
|
|
156
|
-
# return None
|
|
157
|
-
|
|
158
|
-
# def get_all_field_descriptions(self) -> dict[str, str | None]:
|
|
159
|
-
# """Gets descriptions for all fields defined in the model schema.
|
|
160
|
-
|
|
161
|
-
# Returns:
|
|
162
|
-
# dict: A dictionary mapping field names to their descriptions.
|
|
163
|
-
# Only includes fields that have descriptions defined in the schema.
|
|
164
|
-
# """
|
|
165
|
-
# if self._field_descriptions is None:
|
|
166
|
-
# self._field_descriptions = self._compute_field_descriptions()
|
|
167
|
-
# return self._field_descriptions
|
|
168
|
-
|
|
169
|
-
# def _compute_field_descriptions(self) -> dict[str, str | None]:
|
|
170
|
-
# """Computes descriptions for all fields in the model.
|
|
171
|
-
|
|
172
|
-
# Returns:
|
|
173
|
-
# dict: A dictionary mapping field names to their descriptions.
|
|
174
|
-
# """
|
|
175
|
-
# field_descriptions: dict[str, Optional[str]] = {}
|
|
176
|
-
# for field_name, field_info in self.__class__.model_fields.items():
|
|
177
|
-
# if field_name not in self._internal_basemetadata_fields:
|
|
178
|
-
# field_descriptions[field_name] = field_info.description
|
|
179
|
-
# return field_descriptions
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
# class BaseAgentRunMetadata(BaseMetadata):
|
|
183
|
-
# """Extends BaseMetadata with fields specific to agent evaluation runs.
|
|
184
|
-
|
|
185
|
-
# Attributes:
|
|
186
|
-
# scores: Dictionary of evaluation metrics.
|
|
187
|
-
# """
|
|
188
|
-
|
|
189
|
-
# scores: dict[str, int | float | bool | None] = Field(
|
|
190
|
-
# description="A dict of score_key -> score_value. Use one key for each metric you're tracking."
|
|
191
|
-
# )
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
# class InspectAgentRunMetadata(BaseAgentRunMetadata):
|
|
195
|
-
# """Extends BaseAgentRunMetadata with fields specific to Inspect runs.
|
|
196
|
-
|
|
197
|
-
# Attributes:
|
|
198
|
-
# task_id: The ID of the 'benchmark' or 'set of evals' that the transcript belongs to
|
|
199
|
-
# sample_id: The specific task inside of the `task_id` benchmark that the transcript was run on
|
|
200
|
-
# epoch_id: Each `sample_id` should be run multiple times due to stochasticity; `epoch_id` is the integer index of a specific run.
|
|
201
|
-
# model: The model that was used to generate the transcript
|
|
202
|
-
# scoring_metadata: Additional metadata about the scoring process
|
|
203
|
-
# additional_metadata: Additional metadata about the transcript
|
|
204
|
-
# """
|
|
205
|
-
|
|
206
|
-
# task_id: str = Field(
|
|
207
|
-
# description="The ID of the 'benchmark' or 'set of evals' that the transcript belongs to"
|
|
208
|
-
# )
|
|
209
|
-
|
|
210
|
-
# # Identification of this particular run
|
|
211
|
-
# sample_id: str = Field(
|
|
212
|
-
# description="The specific task inside of the `task_id` benchmark that the transcript was run on"
|
|
213
|
-
# )
|
|
214
|
-
# epoch_id: int = Field(
|
|
215
|
-
# description="Each `sample_id` should be run multiple times due to stochasticity; `epoch_id` is the integer index of a specific run."
|
|
216
|
-
# )
|
|
217
|
-
|
|
218
|
-
# # Parameters for the run
|
|
219
|
-
# model: str = Field(description="The model that was used to generate the transcript")
|
|
220
|
-
|
|
221
|
-
# # Scoring
|
|
222
|
-
# scoring_metadata: dict[str, Any] | None = Field(
|
|
223
|
-
# description="Additional metadata about the scoring process"
|
|
224
|
-
# )
|
|
225
|
-
|
|
226
|
-
# # Inspect metadata
|
|
227
|
-
# additional_metadata: dict[str, Any] | None = Field(
|
|
228
|
-
# description="Additional metadata about the transcript"
|
|
229
|
-
# )
|
docent/data_models/yaml_util.py
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
import yaml
|
|
4
|
-
from pydantic_core import to_jsonable_python
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def yaml_dump_metadata(metadata: dict[str, Any]) -> str | None:
|
|
8
|
-
if not metadata:
|
|
9
|
-
return None
|
|
10
|
-
metadata_obj = to_jsonable_python(metadata)
|
|
11
|
-
yaml_text = yaml.dump(metadata_obj, width=float("inf"))
|
|
12
|
-
return yaml_text.strip()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
docent/__init__.py,sha256=fuhETwJPcesiB76Zxa64HBJxeaaTyRalIH-fs77TWsU,112
|
|
2
|
-
docent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
docent/trace.py,sha256=bCO66QFgQ9L_4XM4PXnZToMi1Crtc9n0723kNjwCdm0,66823
|
|
4
|
-
docent/trace_temp.py,sha256=Z0lAPwVzXjFvxpiU-CuvfWIslq9Q4alNkZMoQ77Xudk,40711
|
|
5
|
-
docent/_log_util/__init__.py,sha256=3HXXrxrSm8PxwG4llotrCnSnp7GuroK1FNHsdg6f7aE,73
|
|
6
|
-
docent/_log_util/logger.py,sha256=kwM0yRW1IJd6-XTorjWn48B4l8qvD2ZM6VDjY5eskQI,4422
|
|
7
|
-
docent/data_models/__init__.py,sha256=4JbTDVzRhS5VZgo8MALwd_YI17GaN7X9E3rOc4Xl7kw,327
|
|
8
|
-
docent/data_models/_tiktoken_util.py,sha256=hC0EDDWItv5-0cONBnHWgZtQOflDU7ZNEhXPFo4DvPc,3057
|
|
9
|
-
docent/data_models/agent_run.py,sha256=bsZGL0D3HIO8oxfaeUzaUWRS82u-IiO7vs0-Lv9spks,19970
|
|
10
|
-
docent/data_models/citation.py,sha256=zpF9WuvVEfktltw1M9P3hwpg5yywizFUKF5zROBR2cY,5062
|
|
11
|
-
docent/data_models/metadata.py,sha256=r0SYC4i2x096dXMLfw_rAMtcJQCsoV6EOMPZuEngbGA,9062
|
|
12
|
-
docent/data_models/regex.py,sha256=0ciIerkrNwb91bY5mTcyO5nDWH67xx2tZYObV52fmBo,1684
|
|
13
|
-
docent/data_models/remove_invalid_citation_ranges.py,sha256=U-aIzRL-SuWFQZr1MqEGqXMNyIKQs7VQLxHDoFrMJwI,5658
|
|
14
|
-
docent/data_models/shared_types.py,sha256=jjm-Dh5S6v7UKInW7SEqoziOsx6Z7Uu4e3VzgCbTWvc,225
|
|
15
|
-
docent/data_models/transcript.py,sha256=xA6fcGwYn8ewgqWdIgrXcq1Qbt7rByCKqDabffvCL0A,21387
|
|
16
|
-
docent/data_models/yaml_util.py,sha256=6GrPWqbTZrryZh71cnSsiqbHkWVCd-8V3-6GeiEchUg,325
|
|
17
|
-
docent/data_models/chat/__init__.py,sha256=GleyRzYqKRkwwSRm_tQJw5BudCbgu9WRSa71Fntz0L0,610
|
|
18
|
-
docent/data_models/chat/content.py,sha256=Co-jO8frQa_DSP11wJuhPX0s-GpJk8yqtKqPeiAIZ_U,1672
|
|
19
|
-
docent/data_models/chat/message.py,sha256=xGt09keA6HRxw40xB_toNzEqA9ip7k53dnhXrEbKGO8,4157
|
|
20
|
-
docent/data_models/chat/tool.py,sha256=MMglNHzkwHqUoK0xDWqs2FtelPsgHqwVpGpI1F8KZyw,3049
|
|
21
|
-
docent/loaders/load_inspect.py,sha256=VLrtpvcVZ44n2DIPMwUivXqbvOWjaooGw6moY8UQ0VE,6789
|
|
22
|
-
docent/samples/__init__.py,sha256=roDFnU6515l9Q8v17Es_SpWyY9jbm5d6X9lV01V0MZo,143
|
|
23
|
-
docent/samples/load.py,sha256=ZGE07r83GBNO4A0QBh5aQ18WAu3mTWA1vxUoHd90nrM,207
|
|
24
|
-
docent/samples/log.eval,sha256=orrW__9WBfANq7NwKsPSq9oTsQRcG6KohG5tMr_X_XY,397708
|
|
25
|
-
docent/samples/tb_airline.json,sha256=eR2jFFRtOw06xqbEglh6-dPewjifOk-cuxJq67Dtu5I,47028
|
|
26
|
-
docent/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
-
docent/sdk/agent_run_writer.py,sha256=QNCV4m36c9BuhzWCyuzs0wH9ql8uubzcQUXMhc3XVug,9135
|
|
28
|
-
docent/sdk/client.py,sha256=fuJrTF87OtUojULFY7acZuqg5xmE8F-4HgEeEV8_gq0,14781
|
|
29
|
-
docent_python-0.1.14a0.dist-info/METADATA,sha256=OpxpQ56Pzl7Af2VTR0mi1_VpZRFj6NlEjlqcLRY5Oec,1045
|
|
30
|
-
docent_python-0.1.14a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
31
|
-
docent_python-0.1.14a0.dist-info/licenses/LICENSE.md,sha256=QIMv2UiT6MppRasso4ymaA0w7ltkqmlL0HCt8CLD7Rc,580
|
|
32
|
-
docent_python-0.1.14a0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|