braintrust 0.5.2__tar.gz → 0.5.4__tar.gz

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.
Files changed (140) hide show
  1. {braintrust-0.5.2 → braintrust-0.5.4}/PKG-INFO +1 -1
  2. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/__init__.py +11 -0
  3. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/_generated_types.py +193 -11
  4. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/db_fields.py +10 -0
  5. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/generated_types.py +7 -1
  6. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/logger.py +324 -125
  7. braintrust-0.5.4/src/braintrust/merge_row_batch.py +183 -0
  8. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/oai.py +13 -4
  9. braintrust-0.5.4/src/braintrust/test_context.py +1264 -0
  10. braintrust-0.5.4/src/braintrust/test_merge_row_batch.py +160 -0
  11. braintrust-0.5.4/src/braintrust/version.py +4 -0
  12. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_openai.py +100 -1
  13. braintrust-0.5.4/src/braintrust/wrappers/threads.py +114 -0
  14. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/PKG-INFO +1 -1
  15. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/SOURCES.txt +3 -1
  16. braintrust-0.5.2/src/braintrust/graph_util.py +0 -147
  17. braintrust-0.5.2/src/braintrust/merge_row_batch.py +0 -243
  18. braintrust-0.5.2/src/braintrust/version.py +0 -4
  19. {braintrust-0.5.2 → braintrust-0.5.4}/README.md +0 -0
  20. {braintrust-0.5.2 → braintrust-0.5.4}/setup.cfg +0 -0
  21. {braintrust-0.5.2 → braintrust-0.5.4}/setup.py +0 -0
  22. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/audit.py +0 -0
  23. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/auto.py +0 -0
  24. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/aws.py +0 -0
  25. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/bt_json.py +0 -0
  26. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/__init__.py +0 -0
  27. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/__main__.py +0 -0
  28. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/eval.py +0 -0
  29. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/__init__.py +0 -0
  30. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/api.py +0 -0
  31. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/bump_versions.py +0 -0
  32. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/logs.py +0 -0
  33. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/redshift.py +0 -0
  34. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/install/run_migrations.py +0 -0
  35. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/cli/push.py +0 -0
  36. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/conftest.py +0 -0
  37. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/context.py +0 -0
  38. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/contrib/__init__.py +0 -0
  39. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/contrib/temporal/__init__.py +0 -0
  40. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/contrib/temporal/test_temporal.py +0 -0
  41. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/__init__.py +0 -0
  42. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/auth.py +0 -0
  43. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/cache.py +0 -0
  44. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/cors.py +0 -0
  45. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/dataset.py +0 -0
  46. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/eval_hooks.py +0 -0
  47. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/schemas.py +0 -0
  48. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/server.py +0 -0
  49. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/test_cached_login.py +0 -0
  50. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/test_lru_cache.py +0 -0
  51. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/devserver/test_server_integration.py +0 -0
  52. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/framework.py +0 -0
  53. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/framework2.py +0 -0
  54. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/functions/__init__.py +0 -0
  55. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/functions/constants.py +0 -0
  56. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/functions/invoke.py +0 -0
  57. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/functions/stream.py +0 -0
  58. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/functions/test_invoke.py +0 -0
  59. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/git_fields.py +0 -0
  60. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/gitutil.py +0 -0
  61. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/http_headers.py +0 -0
  62. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/id_gen.py +0 -0
  63. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/object.py +0 -0
  64. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/otel/__init__.py +0 -0
  65. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/otel/context.py +0 -0
  66. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/otel/test_distributed_tracing.py +0 -0
  67. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/otel/test_otel_bt_integration.py +0 -0
  68. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/parameters.py +0 -0
  69. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt.py +0 -0
  70. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/__init__.py +0 -0
  71. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/disk_cache.py +0 -0
  72. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/lru_cache.py +0 -0
  73. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/prompt_cache.py +0 -0
  74. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/test_disk_cache.py +0 -0
  75. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/test_lru_cache.py +0 -0
  76. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/prompt_cache/test_prompt_cache.py +0 -0
  77. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/py.typed +0 -0
  78. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/queue.py +0 -0
  79. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/resource_manager.py +0 -0
  80. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/score.py +0 -0
  81. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/serializable_data_class.py +0 -0
  82. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_cache.py +0 -0
  83. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_identifier_v1.py +0 -0
  84. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_identifier_v2.py +0 -0
  85. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_identifier_v3.py +0 -0
  86. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_identifier_v4.py +0 -0
  87. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/span_types.py +0 -0
  88. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_bt_json.py +0 -0
  89. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_framework.py +0 -0
  90. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_framework2.py +0 -0
  91. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_helpers.py +0 -0
  92. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_http.py +0 -0
  93. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_id_gen.py +0 -0
  94. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_logger.py +0 -0
  95. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_otel.py +0 -0
  96. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_queue.py +0 -0
  97. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_score.py +0 -0
  98. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_serializable_data_class.py +0 -0
  99. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_span_cache.py +0 -0
  100. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_span_components.py +0 -0
  101. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_trace.py +0 -0
  102. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_util.py +0 -0
  103. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/test_version.py +0 -0
  104. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/trace.py +0 -0
  105. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/util.py +0 -0
  106. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/__init__.py +0 -0
  107. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/_anthropic_utils.py +0 -0
  108. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/__init__.py +0 -0
  109. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/agent.py +0 -0
  110. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/function_call.py +0 -0
  111. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/model.py +0 -0
  112. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/team.py +0 -0
  113. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/agno/utils.py +0 -0
  114. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/anthropic.py +0 -0
  115. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/claude_agent_sdk/__init__.py +0 -0
  116. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/claude_agent_sdk/_wrapper.py +0 -0
  117. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/claude_agent_sdk/test_wrapper.py +0 -0
  118. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/dspy.py +0 -0
  119. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/google_genai/__init__.py +0 -0
  120. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/langchain.py +0 -0
  121. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/langsmith_wrapper.py +0 -0
  122. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/litellm.py +0 -0
  123. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/openai.py +0 -0
  124. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/pydantic_ai.py +0 -0
  125. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_agno.py +0 -0
  126. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_anthropic.py +0 -0
  127. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_dspy.py +0 -0
  128. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_google_genai.py +0 -0
  129. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_langsmith_wrapper.py +0 -0
  130. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_litellm.py +0 -0
  131. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_oai_attachments.py +0 -0
  132. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_openrouter.py +0 -0
  133. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_pydantic_ai_integration.py +0 -0
  134. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_pydantic_ai_wrap_openai.py +0 -0
  135. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/wrappers/test_utils.py +0 -0
  136. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust/xact_ids.py +0 -0
  137. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/dependency_links.txt +0 -0
  138. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/entry_points.txt +0 -0
  139. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/requires.txt +0 -0
  140. {braintrust-0.5.2 → braintrust-0.5.4}/src/braintrust.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braintrust
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: SDK for integrating Braintrust
5
5
  Home-page: https://www.braintrust.dev
6
6
  Author: Braintrust
@@ -49,6 +49,17 @@ BRAINTRUST_API_KEY=<YOUR_BRAINTRUST_API_KEY> braintrust eval eval_hello.py
49
49
  ### API Reference
50
50
  """
51
51
 
52
+ # Check env var at import time for auto-instrumentation
53
+ import os
54
+
55
+ if os.getenv("BRAINTRUST_INSTRUMENT_THREADS", "").lower() in ("true", "1", "yes"):
56
+ try:
57
+ from .wrappers.threads import setup_threads
58
+
59
+ setup_threads()
60
+ except Exception:
61
+ pass # Never break on import
62
+
52
63
  from .audit import *
53
64
  from .auto import (
54
65
  auto_instrument, # noqa: F401 # type: ignore[reportUnusedImport]
@@ -167,6 +167,10 @@ AsyncScoringState: TypeAlias = AsyncScoringStateAsyncScoringState | AsyncScoring
167
167
  class PreprocessorPreprocessor(TypedDict):
168
168
  type: Literal['function']
169
169
  id: str
170
+ version: NotRequired[str | None]
171
+ """
172
+ The version of the function
173
+ """
170
174
 
171
175
 
172
176
  class PreprocessorPreprocessor2(TypedDict):
@@ -190,6 +194,10 @@ class BatchedFacetDataFacet(TypedDict):
190
194
  """
191
195
  The model to use for facet extraction
192
196
  """
197
+ embedding_model: NotRequired[str | None]
198
+ """
199
+ The embedding model to use for vectorizing facet results.
200
+ """
193
201
  no_match_pattern: NotRequired[str | None]
194
202
  """
195
203
  Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match'
@@ -638,6 +646,10 @@ class ExperimentEventContext(TypedDict):
638
646
  class ExtendedSavedFunctionIdExtendedSavedFunctionId(TypedDict):
639
647
  type: Literal['function']
640
648
  id: str
649
+ version: NotRequired[str | None]
650
+ """
651
+ The version of the function
652
+ """
641
653
 
642
654
 
643
655
  class ExtendedSavedFunctionIdExtendedSavedFunctionId2(TypedDict):
@@ -668,6 +680,10 @@ class ExternalAttachmentReference(TypedDict):
668
680
  class Preprocessor1Preprocessor1(TypedDict):
669
681
  type: Literal['function']
670
682
  id: str
683
+ version: NotRequired[str | None]
684
+ """
685
+ The version of the function
686
+ """
671
687
 
672
688
 
673
689
  class Preprocessor1Preprocessor12(TypedDict):
@@ -728,9 +744,32 @@ class FunctionDataFunctionData2(TypedDict):
728
744
  endpoint: str
729
745
  eval_name: str
730
746
  parameters: Mapping[str, Any]
747
+ parameters_version: NotRequired[str | None]
748
+ """
749
+ The version (transaction ID) of the parameters being used
750
+ """
751
+
752
+
753
+ class FunctionDataFunctionData4Schema(TypedDict):
754
+ type: Literal['object']
755
+ properties: Mapping[str, Mapping[str, Any]]
756
+ required: NotRequired[Sequence[str] | None]
757
+ additionalProperties: NotRequired[bool | None]
758
+
759
+
760
+ class FunctionDataFunctionData4(TypedDict):
761
+ type: Literal['parameters']
762
+ data: Mapping[str, Any]
763
+ """
764
+ The parameters data
765
+ """
766
+ __schema: FunctionDataFunctionData4Schema
767
+ """
768
+ JSON Schema format for parameters
769
+ """
731
770
 
732
771
 
733
- FunctionFormat: TypeAlias = Literal['llm', 'code', 'global', 'graph']
772
+ FunctionFormat: TypeAlias = Literal['llm', 'code', 'global', 'graph', 'topic_map']
734
773
 
735
774
 
736
775
  class FunctionIdFunctionId(TypedDict):
@@ -795,7 +834,7 @@ FunctionIdRef: TypeAlias = Mapping[str, Any]
795
834
 
796
835
 
797
836
  FunctionObjectType: TypeAlias = Literal[
798
- 'prompt', 'tool', 'scorer', 'task', 'workflow', 'custom_view', 'preprocessor', 'facet', 'classifier'
837
+ 'prompt', 'tool', 'scorer', 'task', 'workflow', 'custom_view', 'preprocessor', 'facet', 'classifier', 'parameters'
799
838
  ]
800
839
 
801
840
 
@@ -803,7 +842,7 @@ FunctionOutputType: TypeAlias = Literal['completion', 'score', 'facet', 'classif
803
842
 
804
843
 
805
844
  FunctionTypeEnum: TypeAlias = Literal[
806
- 'llm', 'scorer', 'task', 'tool', 'custom_view', 'preprocessor', 'facet', 'classifier'
845
+ 'llm', 'scorer', 'task', 'tool', 'custom_view', 'preprocessor', 'facet', 'classifier', 'tag', 'parameters'
807
846
  ]
808
847
  """
809
848
  The type of global function. Defaults to 'scorer'.
@@ -811,7 +850,7 @@ The type of global function. Defaults to 'scorer'.
811
850
 
812
851
 
813
852
  FunctionTypeEnumNullish: TypeAlias = Literal[
814
- 'llm', 'scorer', 'task', 'tool', 'custom_view', 'preprocessor', 'facet', 'classifier'
853
+ 'llm', 'scorer', 'task', 'tool', 'custom_view', 'preprocessor', 'facet', 'classifier', 'tag', 'parameters'
815
854
  ]
816
855
 
817
856
 
@@ -1108,6 +1147,12 @@ class GroupScope(TypedDict):
1108
1147
  IfExists: TypeAlias = Literal['error', 'ignore', 'replace']
1109
1148
 
1110
1149
 
1150
+ ImageRenderingMode: TypeAlias = Literal['auto', 'click_to_load', 'blocked']
1151
+ """
1152
+ Controls how images are rendered in the UI: 'auto' loads images automatically, 'click_to_load' shows a placeholder until clicked, 'blocked' prevents image loading entirely
1153
+ """
1154
+
1155
+
1111
1156
  class InvokeFunctionInvokeFunction(TypedDict):
1112
1157
  function_id: str
1113
1158
  """
@@ -1311,6 +1356,10 @@ class ModelParamsModelParams4(TypedDict):
1311
1356
  class NullableSavedFunctionIdNullableSavedFunctionId(TypedDict):
1312
1357
  type: Literal['function']
1313
1358
  id: str
1359
+ version: NotRequired[str | None]
1360
+ """
1361
+ The version of the function
1362
+ """
1314
1363
 
1315
1364
 
1316
1365
  class NullableSavedFunctionIdNullableSavedFunctionId1(TypedDict):
@@ -1390,6 +1439,7 @@ class Organization(TypedDict):
1390
1439
  """
1391
1440
  Date of organization creation
1392
1441
  """
1442
+ image_rendering_mode: NotRequired[ImageRenderingMode | None]
1393
1443
 
1394
1444
 
1395
1445
  Permission: TypeAlias = Literal[
@@ -2078,6 +2128,10 @@ class RunEvalMcpAuth(TypedDict):
2078
2128
  class SavedFunctionIdSavedFunctionId(TypedDict):
2079
2129
  type: Literal['function']
2080
2130
  id: str
2131
+ version: NotRequired[str | None]
2132
+ """
2133
+ The version of the function
2134
+ """
2081
2135
 
2082
2136
 
2083
2137
  class SavedFunctionIdSavedFunctionId1(TypedDict):
@@ -2209,6 +2263,64 @@ class ToolFunctionDefinition(TypedDict):
2209
2263
  function: ToolFunctionDefinitionFunction
2210
2264
 
2211
2265
 
2266
+ class TopicMapReportSettings(TypedDict):
2267
+ algorithm: Literal['hdbscan', 'kmeans', 'hierarchical']
2268
+ dimension_reduction: Literal['umap', 'pca', 'none']
2269
+ vector_field: str
2270
+ embedding_model: str
2271
+ n_clusters: NotRequired[int | None]
2272
+ umap_dimensions: NotRequired[int | None]
2273
+ min_cluster_size: NotRequired[int | None]
2274
+ min_samples: NotRequired[int | None]
2275
+
2276
+
2277
+ class TopicMapReportQuerySettings(TypedDict):
2278
+ hierarchy_threshold: NotRequired[int | None]
2279
+ auto_naming: NotRequired[bool | None]
2280
+ skip_cache: NotRequired[bool | None]
2281
+ viz_mode: NotRequired[Literal['bar', 'scatter'] | None]
2282
+ naming_model: NotRequired[str | None]
2283
+
2284
+
2285
+ class TopicMapReportClusterSample(TypedDict):
2286
+ id: str
2287
+ text: str
2288
+ root_span_id: str
2289
+ span_id: str
2290
+
2291
+
2292
+ class TopicMapReportCluster(TypedDict):
2293
+ cluster_id: float
2294
+ parent_cluster_id: NotRequired[float | None]
2295
+ topic_id: str
2296
+ count: float
2297
+ sample_texts: Sequence[str]
2298
+ samples: Sequence[TopicMapReportClusterSample]
2299
+ name: NotRequired[str | None]
2300
+ description: NotRequired[str | None]
2301
+ keywords: NotRequired[Sequence[str] | None]
2302
+ centroid: NotRequired[Sequence[float] | None]
2303
+ parent_id: NotRequired[float | None]
2304
+ is_leaf: NotRequired[bool | None]
2305
+ depth: NotRequired[float | None]
2306
+
2307
+
2308
+ class TopicMapReportEmbeddingPoint(TypedDict):
2309
+ x: float
2310
+ y: float
2311
+ cluster: float
2312
+ text: NotRequired[str | None]
2313
+
2314
+
2315
+ class TopicMapReport(TypedDict):
2316
+ version: Literal[1]
2317
+ created_at: NotRequired[str | None]
2318
+ settings: TopicMapReportSettings
2319
+ query_settings: TopicMapReportQuerySettings
2320
+ clusters: Sequence[TopicMapReportCluster]
2321
+ embedding_points: NotRequired[Sequence[TopicMapReportEmbeddingPoint] | None]
2322
+
2323
+
2212
2324
  class TraceScope(TypedDict):
2213
2325
  type: Literal['trace']
2214
2326
  idle_seconds: NotRequired[float | None]
@@ -2473,12 +2585,6 @@ class PreprocessorPreprocessor4(PreprocessorPreprocessor1, PreprocessorPreproces
2473
2585
  Preprocessor: TypeAlias = PreprocessorPreprocessor3 | PreprocessorPreprocessor4
2474
2586
 
2475
2587
 
2476
- class BatchedFacetData(TypedDict):
2477
- type: Literal['batched_facet']
2478
- preprocessor: NotRequired[Preprocessor | None]
2479
- facets: Sequence[BatchedFacetDataFacet]
2480
-
2481
-
2482
2588
  ChatCompletionContentPart: TypeAlias = (
2483
2589
  ChatCompletionContentPartTextWithTitle
2484
2590
  | ChatCompletionContentPartImageWithTitle
@@ -2590,6 +2696,14 @@ class DatasetEvent(TypedDict):
2590
2696
  """
2591
2697
  Optional list of audit entries attached to this event
2592
2698
  """
2699
+ facets: NotRequired[Mapping[str, Any] | None]
2700
+ """
2701
+ Facets for categorization (dictionary from facet id to value)
2702
+ """
2703
+ classifications: NotRequired[Mapping[str, Any] | None]
2704
+ """
2705
+ Classifications for this event (dictionary from classification name to items)
2706
+ """
2593
2707
 
2594
2708
 
2595
2709
  class EvalStatusPage(TypedDict):
@@ -2726,6 +2840,10 @@ class FacetData(TypedDict):
2726
2840
  """
2727
2841
  The model to use for facet extraction
2728
2842
  """
2843
+ embedding_model: NotRequired[str | None]
2844
+ """
2845
+ The embedding model to use for vectorizing facet results.
2846
+ """
2729
2847
  no_match_pattern: NotRequired[str | None]
2730
2848
  """
2731
2849
  Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match'
@@ -3009,11 +3127,54 @@ class SpanAttributes(TypedDict):
3009
3127
  type: NotRequired[SpanType | None]
3010
3128
 
3011
3129
 
3130
+ class TopicMapData(TypedDict):
3131
+ type: Literal['topic_map']
3132
+ source_facet: str
3133
+ """
3134
+ The facet field name to use as input for classification
3135
+ """
3136
+ embedding_model: str
3137
+ """
3138
+ The embedding model to use for embedding facet values
3139
+ """
3140
+ bundle_key: str
3141
+ """
3142
+ Key of the topic map bundle in code_bundles bucket
3143
+ """
3144
+ distance_threshold: NotRequired[float | None]
3145
+ """
3146
+ Maximum distance to nearest centroid. If exceeded, returns no_match.
3147
+ """
3148
+ report: NotRequired[TopicMapReport | None]
3149
+
3150
+
3012
3151
  class ViewData(TypedDict):
3013
3152
  search: NotRequired[ViewDataSearch | None]
3014
3153
  custom_charts: NotRequired[Any | None]
3015
3154
 
3016
3155
 
3156
+ class BatchedFacetDataTopicMaps(TypedDict):
3157
+ function_name: str
3158
+ """
3159
+ The name of the topic map function
3160
+ """
3161
+ topic_map_id: NotRequired[str | None]
3162
+ """
3163
+ The id of the topic map function
3164
+ """
3165
+ topic_map_data: TopicMapData
3166
+
3167
+
3168
+ class BatchedFacetData(TypedDict):
3169
+ type: Literal['batched_facet']
3170
+ preprocessor: NotRequired[Preprocessor | None]
3171
+ facets: Sequence[BatchedFacetDataFacet]
3172
+ topic_maps: NotRequired[Mapping[str, BatchedFacetDataTopicMaps] | None]
3173
+ """
3174
+ Topic maps that depend on facets in this batch, keyed by source facet name
3175
+ """
3176
+
3177
+
3017
3178
  class ExperimentEvent(TypedDict):
3018
3179
  id: str
3019
3180
  """
@@ -3101,6 +3262,14 @@ class ExperimentEvent(TypedDict):
3101
3262
  """
3102
3263
  Optional list of audit entries attached to this event
3103
3264
  """
3265
+ facets: NotRequired[Mapping[str, Any] | None]
3266
+ """
3267
+ Facets for categorization (dictionary from facet id to value)
3268
+ """
3269
+ classifications: NotRequired[Mapping[str, Any] | None]
3270
+ """
3271
+ Classifications for this event (dictionary from classification name to items)
3272
+ """
3104
3273
 
3105
3274
 
3106
3275
  class GraphNodeGraphNode7(TypedDict):
@@ -3223,6 +3392,14 @@ class ProjectLogsEvent(TypedDict):
3223
3392
  """
3224
3393
  The async scoring state for this event
3225
3394
  """
3395
+ facets: NotRequired[Mapping[str, Any] | None]
3396
+ """
3397
+ Facets for categorization (dictionary from facet id to value)
3398
+ """
3399
+ classifications: NotRequired[Mapping[str, Any] | None]
3400
+ """
3401
+ Classifications for this event (dictionary from classification name to items)
3402
+ """
3226
3403
 
3227
3404
 
3228
3405
  class ProjectScore(TypedDict):
@@ -3325,12 +3502,15 @@ class View(TypedDict):
3325
3502
  'datasets',
3326
3503
  'dataset',
3327
3504
  'prompts',
3505
+ 'parameters',
3328
3506
  'tools',
3329
3507
  'scorers',
3330
3508
  'classifiers',
3331
3509
  'logs',
3332
3510
  'monitor',
3333
- 'for_review',
3511
+ 'for_review_project_log',
3512
+ 'for_review_experiments',
3513
+ 'for_review_datasets',
3334
3514
  ]
3335
3515
  """
3336
3516
  Type of object that the view corresponds to.
@@ -3564,6 +3744,8 @@ FunctionData: TypeAlias = (
3564
3744
  | FunctionDataFunctionData3
3565
3745
  | FacetData
3566
3746
  | BatchedFacetData
3747
+ | FunctionDataFunctionData4
3748
+ | TopicMapData
3567
3749
  )
3568
3750
 
3569
3751
 
@@ -15,3 +15,13 @@ PARENT_ID_FIELD = "_parent_id"
15
15
 
16
16
  ASYNC_SCORING_CONTROL_FIELD = "_async_scoring_control"
17
17
  SKIP_ASYNC_SCORING_FIELD = "_skip_async_scoring"
18
+
19
+ # Keys that identify which object (experiment, dataset, project logs, etc.) a row belongs to.
20
+ OBJECT_ID_KEYS = (
21
+ "experiment_id",
22
+ "dataset_id",
23
+ "prompt_session_id",
24
+ "project_id",
25
+ "log_id",
26
+ "function_data",
27
+ )
@@ -1,4 +1,4 @@
1
- """Auto-generated file (internal git SHA 21146f64bf5ad1eadd3a99d186274728e25e5399) -- do not modify"""
1
+ """Auto-generated file (internal git SHA 2822255bed426d5442adc880a8f71b8a378de3d4) -- do not modify"""
2
2
 
3
3
  from ._generated_types import (
4
4
  Acl,
@@ -53,6 +53,7 @@ from ._generated_types import (
53
53
  Group,
54
54
  GroupScope,
55
55
  IfExists,
56
+ ImageRenderingMode,
56
57
  InvokeFunction,
57
58
  InvokeParent,
58
59
  MCPServer,
@@ -100,6 +101,8 @@ from ._generated_types import (
100
101
  SSEProgressEventData,
101
102
  StreamingMode,
102
103
  ToolFunctionDefinition,
104
+ TopicMapData,
105
+ TopicMapReport,
103
106
  TraceScope,
104
107
  TriggeredFunctionState,
105
108
  UploadStatus,
@@ -163,6 +166,7 @@ __all__ = [
163
166
  "Group",
164
167
  "GroupScope",
165
168
  "IfExists",
169
+ "ImageRenderingMode",
166
170
  "InvokeFunction",
167
171
  "InvokeParent",
168
172
  "MCPServer",
@@ -210,6 +214,8 @@ __all__ = [
210
214
  "SpanType",
211
215
  "StreamingMode",
212
216
  "ToolFunctionDefinition",
217
+ "TopicMapData",
218
+ "TopicMapReport",
213
219
  "TraceScope",
214
220
  "TriggeredFunctionState",
215
221
  "UploadStatus",