From 0d12cfb772ac3de6c00d3f32258e510079369c63 Mon Sep 17 00:00:00 2001 From: "braintrust-bot[bot]" <215900051+braintrust-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 22:04:27 +0000 Subject: [PATCH] chore: Update platform types --- generated_types.json | 64 +++++++++++++++++++++++++++ py/src/braintrust/_generated_types.py | 30 +++++++++++++ py/src/braintrust/generated_types.py | 4 +- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/generated_types.json b/generated_types.json index f9d2933c9..6cc975a59 100644 --- a/generated_types.json +++ b/generated_types.json @@ -5315,6 +5315,64 @@ ], "description": "Each permission permits a certain type of operation on an object in the system\n\nPermissions can be assigned to to objects on an individual basis, or grouped into roles" }, + "PreprocessorSavedFunctionId": { + "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" + }, + { + "type": "null" + } + ], + "description": "For prompt-backed scorers: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor." + }, "Project": { "type": "object", "properties": { @@ -6811,6 +6869,9 @@ "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, + "preprocessor": { + "$ref": "#/components/schemas/PreprocessorSavedFunctionId" + }, "tool_functions": { "type": [ "array", @@ -6940,6 +7001,9 @@ "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, + "preprocessor": { + "$ref": "#/components/schemas/PreprocessorSavedFunctionId" + }, "tool_functions": { "type": [ "array", diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index d02832075..68521caff 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -1632,6 +1632,34 @@ class Organization(TypedDict): """ +class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId(TypedDict): + type: Literal['function'] + id: str + version: NotRequired[str | None] + """ + The version of the function + """ + + +class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1(TypedDict): + type: Literal['global'] + name: str + function_type: NotRequired[Literal['preprocessor'] | None] + """ + The type of global function. Defaults to 'preprocessor'. + """ + + +PreprocessorSavedFunctionId: TypeAlias = ( + PreprocessorSavedFunctionIdPreprocessorSavedFunctionId + | PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1 + | None +) +""" +For prompt-backed scorers: the preprocessor function to use for trace template variables. Set to null to disable preprocessing. If omitted, the traced project's default preprocessor will be used, falling back to the global 'thread' preprocessor. +""" + + class ProjectAutomationConfigAction(TypedDict): type: Literal['webhook'] """ @@ -3982,6 +4010,7 @@ class PromptData(TypedDict): prompt: NotRequired[PromptBlockDataNullish | None] options: NotRequired[PromptOptionsNullish | None] parser: NotRequired[PromptParserNullish | None] + preprocessor: NotRequired[PreprocessorSavedFunctionId | None] tool_functions: NotRequired[Sequence[SavedFunctionId] | None] template_format: NotRequired[Literal['mustache', 'nunjucks', 'none'] | None] mcp: NotRequired[Mapping[str, Any] | None] @@ -3992,6 +4021,7 @@ class PromptDataNullish(TypedDict): prompt: NotRequired[PromptBlockDataNullish | None] options: NotRequired[PromptOptionsNullish | None] parser: NotRequired[PromptParserNullish | None] + preprocessor: NotRequired[PreprocessorSavedFunctionId | None] tool_functions: NotRequired[Sequence[SavedFunctionId] | None] template_format: NotRequired[Literal['mustache', 'nunjucks', 'none'] | None] mcp: NotRequired[Mapping[str, Any] | None] diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index d1860551d..556b04b19 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash 265d32c75b7526f2) -- do not modify""" +"""Auto-generated file (content hash ecb294cff7f76552) -- do not modify""" from ._generated_types import ( Acl, @@ -66,6 +66,7 @@ Organization, OrgAutomation, Permission, + PreprocessorSavedFunctionId, Project, ProjectAutomation, ProjectLogsEvent, @@ -187,6 +188,7 @@ "OrgAutomation", "Organization", "Permission", + "PreprocessorSavedFunctionId", "Project", "ProjectAutomation", "ProjectLogsEvent",