From b5cad5bb06f246683f91593afffe807b0d4faf67 Mon Sep 17 00:00:00 2001 From: "braintrust-bot[bot]" <215900051+braintrust-bot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:28:47 +0000 Subject: [PATCH] chore: generated SDK types --- generated_types.json | 133 +++++++++++++++++++++- py/src/braintrust/_generated_types.py | 154 +++++++++++++++++--------- py/src/braintrust/generated_types.py | 6 +- 3 files changed, 239 insertions(+), 54 deletions(-) diff --git a/generated_types.json b/generated_types.json index a6bb9f83..aa8a1af5 100644 --- a/generated_types.json +++ b/generated_types.json @@ -1973,6 +1973,16 @@ "format": "uuid", "description": "Identifies the user who created the dataset" }, + "tags": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "A list of tags for the dataset" + }, "metadata": { "type": [ "object", @@ -2213,6 +2223,51 @@ "root_span_id" ] }, + "DatasetSnapshot": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the dataset snapshot" + }, + "dataset_id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the dataset that this snapshot belongs to" + }, + "name": { + "type": "string", + "description": "Name of the dataset snapshot" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "xact_id": { + "type": "string", + "description": "Transaction id of the brainstore version at the time of the snapshot" + }, + "created": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Date of dataset snapshot creation" + } + }, + "required": [ + "id", + "dataset_id", + "name", + "description", + "xact_id", + "created" + ] + }, "EnvVar": { "type": "object", "properties": { @@ -5173,7 +5228,7 @@ "description": "Textual description of the project automation" }, "config": { - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { @@ -7716,6 +7771,22 @@ ], "description": "Optional BTQL filter applied before topic automation." }, + "rerun_seconds": { + "type": [ + "number", + "null" + ], + "minimum": 600, + "description": "How often to recompute topic maps" + }, + "relabel_overlap_seconds": { + "type": [ + "number", + "null" + ], + "minimum": 60, + "description": "How much recent history to relabel after a new topic map version becomes active" + }, "backfill_time_range": { "anyOf": [ { @@ -7740,7 +7811,7 @@ "type": "null" } ], - "description": "Optional default time range for backfill operations." + "description": "Topic window used for classification coverage and initial backfill." } }, "required": [ @@ -7836,6 +7907,9 @@ }, "description": "Mapping from topic_id to topic name" }, + "generation_settings": { + "$ref": "#/components/schemas/TopicMapGenerationSettings" + }, "distance_threshold": { "type": "number", "description": "Maximum distance to nearest centroid. If exceeded, returns no_match." @@ -7872,6 +7946,54 @@ "function" ] }, + "TopicMapGenerationSettings": { + "type": "object", + "properties": { + "algorithm": { + "type": "string", + "enum": [ + "hdbscan", + "kmeans" + ] + }, + "dimension_reduction": { + "type": "string", + "enum": [ + "umap", + "pca", + "none" + ] + }, + "sample_size": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "n_clusters": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "min_cluster_size": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "min_samples": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "hierarchy_threshold": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "naming_model": { + "type": "string" + } + }, + "required": [ + "algorithm", + "dimension_reduction" + ], + "description": "Clustering and naming settings used to generate this topic map" + }, "TraceScope": { "type": "object", "properties": { @@ -8030,6 +8152,13 @@ ], "format": "date-time", "description": "Date of user creation" + }, + "last_active_at": { + "type": [ + "number", + "null" + ], + "description": "Unix timestamp in milliseconds of the user's last activity, when available" } }, "required": [ diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index 60ad11c9..4aed5ca0 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -533,6 +533,10 @@ class Dataset(TypedDict): """ Identifies the user who created the dataset """ + tags: NotRequired[Sequence[str] | None] + """ + A list of tags for the dataset + """ metadata: NotRequired[Mapping[str, Any] | None] """ User-controlled metadata about the dataset @@ -550,6 +554,30 @@ class DatasetEventMetadata(TypedDict): """ +class DatasetSnapshot(TypedDict): + id: str + """ + Unique identifier for the dataset snapshot + """ + dataset_id: str + """ + Unique identifier for the dataset that this snapshot belongs to + """ + name: str + """ + Name of the dataset snapshot + """ + description: str | None + xact_id: str + """ + Transaction id of the brainstore version at the time of the snapshot + """ + created: str | None + """ + Date of dataset snapshot creation + """ + + class EnvVar(TypedDict): id: str """ @@ -2399,34 +2427,6 @@ class TopicAutomationDataScopeTopicAutomationDataScope2(TypedDict): """ -class TopicMapData(TypedDict): - type: Literal['topic_map'] - source_facet: str - """ - The facet field name to use as input for classification - """ - embedding_model: str - """ - The embedding model to use for embedding facet values - """ - bundle_key: NotRequired[str | None] - """ - Key of the topic map bundle in code_bundles bucket - """ - report_key: NotRequired[str | None] - """ - Key of the clustering report in code_bundles bucket - """ - topic_names: NotRequired[Mapping[str, str] | None] - """ - Mapping from topic_id to topic name - """ - distance_threshold: NotRequired[float | None] - """ - Maximum distance to nearest centroid. If exceeded, returns no_match. - """ - - class Function1Function1(TypedDict): type: Literal['function'] id: str @@ -2465,6 +2465,17 @@ class TopicMapFunctionAutomation(TypedDict): """ +class TopicMapGenerationSettings(TypedDict): + algorithm: Literal['hdbscan', 'kmeans'] + dimension_reduction: Literal['umap', 'pca', 'none'] + sample_size: NotRequired[int | None] + n_clusters: NotRequired[int | None] + min_cluster_size: NotRequired[int | None] + min_samples: NotRequired[int | None] + hierarchy_threshold: NotRequired[int | None] + naming_model: NotRequired[str | None] + + class TraceScope(TypedDict): type: Literal['trace'] idle_seconds: NotRequired[float | None] @@ -2542,6 +2553,10 @@ class User(TypedDict): """ Date of user creation """ + last_active_at: NotRequired[float | None] + """ + Unix timestamp in milliseconds of the user's last activity, when available + """ class ViewDataSearch(TypedDict): @@ -2746,28 +2761,6 @@ class PreprocessorPreprocessor4(PreprocessorPreprocessor1, PreprocessorPreproces Preprocessor: TypeAlias = PreprocessorPreprocessor3 | PreprocessorPreprocessor4 -class BatchedFacetDataTopicMap(TypedDict): - function_name: str - """ - The name of the topic map function - """ - topic_map_id: NotRequired[str | None] - """ - The id of the topic map function - """ - topic_map_data: TopicMapData - - -class BatchedFacetData(TypedDict): - type: Literal['batched_facet'] - preprocessor: NotRequired[Preprocessor | None] - facets: Sequence[BatchedFacetDataFacet] - topic_maps: NotRequired[Mapping[str, Sequence[BatchedFacetDataTopicMap]] | None] - """ - Topic maps that depend on facets in this batch, keyed by source facet name. Each source facet can have multiple topic maps. - """ - - ChatCompletionContentPart: TypeAlias = ( ChatCompletionContentPartTextWithTitle | ChatCompletionContentPartImageWithTitle @@ -3357,11 +3350,48 @@ class TopicAutomationConfig(TypedDict): """ Optional BTQL filter applied before topic automation. """ + rerun_seconds: NotRequired[float | None] + """ + How often to recompute topic maps + """ + relabel_overlap_seconds: NotRequired[float | None] + """ + How much recent history to relabel after a new topic map version becomes active + """ backfill_time_range: NotRequired[ str | TopicAutomationConfigBackfillTimeRange | None ] """ - Optional default time range for backfill operations. + Topic window used for classification coverage and initial backfill. + """ + + +class TopicMapData(TypedDict): + type: Literal['topic_map'] + source_facet: str + """ + The facet field name to use as input for classification + """ + embedding_model: str + """ + The embedding model to use for embedding facet values + """ + bundle_key: NotRequired[str | None] + """ + Key of the topic map bundle in code_bundles bucket + """ + report_key: NotRequired[str | None] + """ + Key of the clustering report in code_bundles bucket + """ + topic_names: NotRequired[Mapping[str, str] | None] + """ + Mapping from topic_id to topic name + """ + generation_settings: NotRequired[TopicMapGenerationSettings | None] + distance_threshold: NotRequired[float | None] + """ + Maximum distance to nearest centroid. If exceeded, returns no_match. """ @@ -3370,6 +3400,28 @@ class ViewData(TypedDict): custom_charts: NotRequired[Any | None] +class BatchedFacetDataTopicMap(TypedDict): + function_name: str + """ + The name of the topic map function + """ + topic_map_id: NotRequired[str | None] + """ + The id of the topic map function + """ + topic_map_data: TopicMapData + + +class BatchedFacetData(TypedDict): + type: Literal['batched_facet'] + preprocessor: NotRequired[Preprocessor | None] + facets: Sequence[BatchedFacetDataFacet] + topic_maps: NotRequired[Mapping[str, Sequence[BatchedFacetDataTopicMap]] | None] + """ + Topic maps that depend on facets in this batch, keyed by source facet name. Each source facet can have multiple topic maps. + """ + + class ExperimentEvent(TypedDict): id: str """ diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index 4e4fd14f..047345c2 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash f3497ec890b91a97) -- do not modify""" +"""Auto-generated file (content hash 2c789f9d429f1363) -- do not modify""" from ._generated_types import ( Acl, @@ -28,6 +28,7 @@ CodeBundle, Dataset, DatasetEvent, + DatasetSnapshot, EnvVar, EvalStatusPage, EvalStatusPageConfig, @@ -105,6 +106,7 @@ TopicAutomationDataScope, TopicMapData, TopicMapFunctionAutomation, + TopicMapGenerationSettings, TraceScope, TriggeredFunctionState, UploadStatus, @@ -144,6 +146,7 @@ "CodeBundle", "Dataset", "DatasetEvent", + "DatasetSnapshot", "EnvVar", "EvalStatusPage", "EvalStatusPageConfig", @@ -221,6 +224,7 @@ "TopicAutomationDataScope", "TopicMapData", "TopicMapFunctionAutomation", + "TopicMapGenerationSettings", "TraceScope", "TriggeredFunctionState", "UploadStatus",