diff --git a/generated_types.json b/generated_types.json index 6d048372..e79e49ed 100644 --- a/generated_types.json +++ b/generated_types.json @@ -5393,7 +5393,7 @@ ], "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": { + "PreprocessorId": { "anyOf": [ { "type": "object", @@ -5445,11 +5445,32 @@ ], "title": "preprocessor_global" }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "inline" + ] + }, + "code": { + "type": "string", + "minLength": 1, + "description": "The complete JavaScript preprocessor implementation, including its handler." + } + }, + "required": [ + "type", + "code" + ], + "title": "preprocessor_inline" + }, { "type": "null" } ], - "description": "For prompt-backed functions: 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." + "description": "For prompt-backed functions: the saved, global, or inline preprocessor 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", @@ -7047,7 +7068,7 @@ "$ref": "#/components/schemas/PromptParserNullish" }, "preprocessor": { - "$ref": "#/components/schemas/PreprocessorSavedFunctionId" + "$ref": "#/components/schemas/PreprocessorId" }, "tool_functions": { "type": [ @@ -7179,7 +7200,7 @@ "$ref": "#/components/schemas/PromptParserNullish" }, "preprocessor": { - "$ref": "#/components/schemas/PreprocessorSavedFunctionId" + "$ref": "#/components/schemas/PreprocessorId" }, "tool_functions": { "type": [ diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index ea207899..f652635b 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -1618,7 +1618,7 @@ class Organization(TypedDict): """ -class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId(TypedDict): +class PreprocessorIdPreprocessorId(TypedDict): type: Literal['function'] id: str version: NotRequired[str | None] @@ -1627,7 +1627,7 @@ class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId(TypedDict): """ -class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1(TypedDict): +class PreprocessorIdPreprocessorId1(TypedDict): type: Literal['global'] name: str function_type: NotRequired[Literal['preprocessor'] | None] @@ -1636,13 +1636,22 @@ class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1(TypedDict): """ -PreprocessorSavedFunctionId: TypeAlias = ( - PreprocessorSavedFunctionIdPreprocessorSavedFunctionId - | PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1 +class PreprocessorIdPreprocessorId2(TypedDict): + type: Literal['inline'] + code: str + """ + The complete JavaScript preprocessor implementation, including its handler. + """ + + +PreprocessorId: TypeAlias = ( + PreprocessorIdPreprocessorId + | PreprocessorIdPreprocessorId1 + | PreprocessorIdPreprocessorId2 | None ) """ -For prompt-backed functions: 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. +For prompt-backed functions: the saved, global, or inline preprocessor 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. """ @@ -4267,7 +4276,7 @@ class PromptData(TypedDict): prompt: NotRequired[PromptBlockDataNullish | None] options: NotRequired[PromptOptionsNullish | None] parser: NotRequired[PromptParserNullish | None] - preprocessor: NotRequired[PreprocessorSavedFunctionId | None] + preprocessor: NotRequired[PreprocessorId | None] tool_functions: NotRequired[Sequence[SavedFunctionId] | None] template_format: NotRequired[Literal['mustache', 'nunjucks', 'none'] | None] mcp: NotRequired[Mapping[str, Any] | None] @@ -4278,7 +4287,7 @@ class PromptDataNullish(TypedDict): prompt: NotRequired[PromptBlockDataNullish | None] options: NotRequired[PromptOptionsNullish | None] parser: NotRequired[PromptParserNullish | None] - preprocessor: NotRequired[PreprocessorSavedFunctionId | None] + preprocessor: NotRequired[PreprocessorId | 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 e09a2d67..b3793eb0 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash e392acbca346c32a) -- do not modify""" +"""Auto-generated file (content hash 1b7d1d7656432f9e) -- do not modify""" from ._generated_types import ( Acl, @@ -67,7 +67,7 @@ Organization, OrgAutomation, Permission, - PreprocessorSavedFunctionId, + PreprocessorId, Project, ProjectAutomation, ProjectGroup, @@ -192,7 +192,7 @@ "OrgAutomation", "Organization", "Permission", - "PreprocessorSavedFunctionId", + "PreprocessorId", "Project", "ProjectAutomation", "ProjectGroup",