Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions generated_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -6811,6 +6869,9 @@
"parser": {
"$ref": "#/components/schemas/PromptParserNullish"
},
"preprocessor": {
"$ref": "#/components/schemas/PreprocessorSavedFunctionId"
},
"tool_functions": {
"type": [
"array",
Expand Down Expand Up @@ -6940,6 +7001,9 @@
"parser": {
"$ref": "#/components/schemas/PromptParserNullish"
},
"preprocessor": {
"$ref": "#/components/schemas/PreprocessorSavedFunctionId"
},
"tool_functions": {
"type": [
"array",
Expand Down
30 changes: 30 additions & 0 deletions py/src/braintrust/_generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
"""
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down
4 changes: 3 additions & 1 deletion py/src/braintrust/generated_types.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -66,6 +66,7 @@
Organization,
OrgAutomation,
Permission,
PreprocessorSavedFunctionId,
Project,
ProjectAutomation,
ProjectLogsEvent,
Expand Down Expand Up @@ -187,6 +188,7 @@
"OrgAutomation",
"Organization",
"Permission",
"PreprocessorSavedFunctionId",
"Project",
"ProjectAutomation",
"ProjectLogsEvent",
Expand Down