From f97105cb4b4b39d35384bcbe81b4572c589b8684 Mon Sep 17 00:00:00 2001 From: "braintrust-bot[bot]" <215900051+braintrust-bot[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 02:19:35 +0000 Subject: [PATCH] chore: Update platform types --- generated_types.json | 127 +++++++++++++++++++++----- py/src/braintrust/_generated_types.py | 63 +++++++++++-- py/src/braintrust/generated_types.py | 6 +- 3 files changed, 160 insertions(+), 36 deletions(-) diff --git a/generated_types.json b/generated_types.json index b9e0a2f8..cd7d8f37 100644 --- a/generated_types.json +++ b/generated_types.json @@ -7717,6 +7717,41 @@ ], "description": "Whether new and reactivated informational Patterns send alerts, independent of `pattern_alert_min_severity`. Unset or null sends them." }, + "pattern_sources": { + "type": [ + "array", + "null" + ], + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "minLength": 1, + "maxLength": 64 + }, + "mcp_server_id": { + "type": "string", + "format": "uuid", + "description": "The project MCP server that reads this source." + }, + "instructions": { + "type": [ + "string", + "null" + ], + "maxLength": 4000, + "description": "What the user wants Patterns to look for in this source, in their own words." + } + }, + "required": [ + "type", + "mcp_server_id" + ] + }, + "maxItems": 10, + "description": "Sources outside Braintrust that Patterns reads alongside this project's logs, each through a project MCP server." + }, "pattern_excluded_categories": { "type": [ "array", @@ -9155,6 +9190,10 @@ "data": { "type": "array", "items": {} + }, + "source_dataset_id": { + "type": "string", + "description": "The saved dataset these rows came from. Its project scopes saved simulated-user references; the caller must have read access to the dataset and source project." } }, "required": [ @@ -9338,9 +9377,6 @@ "null" ], "description": "Name of the AI provider secret to pin this run to." - }, - "simulated_user": { - "$ref": "#/components/schemas/SimulatedUserReference" } }, "required": [ @@ -9399,6 +9435,61 @@ } ] }, + "SavedPreprocessorId": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "id": { + "type": "string" + }, + "version": { + "type": "string", + "description": "The version of the function" + } + }, + "required": [ + "type", + "id" + ], + "title": "function" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "global" + ] + }, + "name": { + "type": "string" + }, + "function_type": { + "type": "string", + "enum": [ + "preprocessor" + ], + "default": "preprocessor", + "description": "The type of global function. Defaults to 'preprocessor'." + } + }, + "required": [ + "type", + "name" + ], + "title": "preprocessor_global" + } + ], + "description": "Saved preprocessor that renders traces for the project's pattern questions. The project default when unset." + }, "ScoreObject": { "type": "object", "properties": { @@ -9540,27 +9631,6 @@ "preview_name" ] }, - "SimulatedUserReference": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "simulated_user" - ] - }, - "id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the simulated user" - } - }, - "required": [ - "type", - "id" - ], - "description": "A saved simulated user in `project_id` to run every row of a conversation task against. Each row's input becomes the conversation scenario." - }, "SpanAttributes": { "type": [ "object", @@ -11276,6 +11346,15 @@ ], "description": "Optional Loop agent to run for each triggered window" }, + "patterns": { + "type": "object", + "properties": { + "preprocessor": { + "$ref": "#/components/schemas/SavedPreprocessorId" + } + }, + "description": "Settings of the Patterns automation" + }, "actions": { "type": "array", "items": { diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index 6ad89253..50732f51 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -2380,6 +2380,18 @@ class ProjectSettingsPatternAlertDestinations2(TypedDict): """ +class ProjectSettingsPatternSource(TypedDict): + type: str + mcp_server_id: str + """ + The project MCP server that reads this source. + """ + instructions: NotRequired[str | None] + """ + What the user wants Patterns to look for in this source, in their own words. + """ + + ProjectSettingsPatternExcludedCategory: TypeAlias = str @@ -2446,6 +2458,10 @@ class ProjectSettings(TypedDict): """ Whether new and reactivated informational Patterns send alerts, independent of `pattern_alert_min_severity`. Unset or null sends them. """ + pattern_sources: NotRequired[Sequence[ProjectSettingsPatternSource] | None] + """ + Sources outside Braintrust that Patterns reads alongside this project's logs, each through a project MCP server. + """ pattern_excluded_categories: NotRequired[ Sequence[ProjectSettingsPatternExcludedCategory] ] @@ -2859,6 +2875,10 @@ class RunEvalData1(TypedDict): class RunEvalData2(TypedDict): data: Sequence[Any] + source_dataset_id: NotRequired[str | None] + """ + The saved dataset these rows came from. Its project scopes saved simulated-user references; the caller must have read access to the dataset and source project. + """ class RunEvalData3(TypedDict): @@ -3025,6 +3045,32 @@ class SavedFunctionIdSavedFunctionId1(TypedDict): ) +class SavedPreprocessorIdSavedPreprocessorId(TypedDict): + type: Literal['function'] + id: str + version: NotRequired[str | None] + """ + The version of the function + """ + + +class SavedPreprocessorIdSavedPreprocessorId1(TypedDict): + type: Literal['global'] + name: str + function_type: NotRequired[Literal['preprocessor'] | None] + """ + The type of global function. Defaults to 'preprocessor'. + """ + + +SavedPreprocessorId: TypeAlias = ( + SavedPreprocessorIdSavedPreprocessorId | SavedPreprocessorIdSavedPreprocessorId1 +) +""" +Saved preprocessor that renders traces for the project's pattern questions. The project default when unset. +""" + + class ScoreObject(TypedDict): name: NotRequired[str | None] """ @@ -3085,14 +3131,6 @@ class ServiceToken(TypedDict): """ -class SimulatedUserReference(TypedDict): - type: Literal['simulated_user'] - id: str - """ - Unique identifier for the simulated user - """ - - class SpanIFrame(TypedDict): id: str """ @@ -3688,6 +3726,10 @@ class WindowedAutomationConfigLoop(TypedDict): """ +class WindowedAutomationConfigPatterns(TypedDict): + preprocessor: NotRequired[SavedPreprocessorId | None] + + class WindowedAutomationConfigActionsHeaders(TypedDict): name: str """ @@ -3796,6 +3838,10 @@ class WindowedAutomationConfig(TypedDict): """ Optional Loop agent to run for each triggered window """ + patterns: NotRequired[WindowedAutomationConfigPatterns | None] + """ + Settings of the Patterns automation + """ actions: NotRequired[ Sequence[ WindowedAutomationConfigActions @@ -5312,7 +5358,6 @@ class RunEval(TypedDict): """ Name of the AI provider secret to pin this run to. """ - simulated_user: NotRequired[SimulatedUserReference | None] FunctionData: TypeAlias = ( diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index 70e9de76..50e8ced8 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash 27700e0e5ff653bc) -- do not modify""" +"""Auto-generated file (content hash 771d6dc8c81f3b48) -- do not modify""" from ._generated_types import ( Acl, @@ -99,10 +99,10 @@ Role, RunEval, SavedFunctionId, + SavedPreprocessorId, ScoreObject, ScoreResult, ServiceToken, - SimulatedUserReference, SpanAttributes, SpanIFrame, SpanScope, @@ -231,10 +231,10 @@ "SSEConsoleEventData", "SSEProgressEventData", "SavedFunctionId", + "SavedPreprocessorId", "ScoreObject", "ScoreResult", "ServiceToken", - "SimulatedUserReference", "SpanAttributes", "SpanIFrame", "SpanScope",