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
29 changes: 25 additions & 4 deletions generated_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -7047,7 +7068,7 @@
"$ref": "#/components/schemas/PromptParserNullish"
},
"preprocessor": {
"$ref": "#/components/schemas/PreprocessorSavedFunctionId"
"$ref": "#/components/schemas/PreprocessorId"
},
"tool_functions": {
"type": [
Expand Down Expand Up @@ -7179,7 +7200,7 @@
"$ref": "#/components/schemas/PromptParserNullish"
},
"preprocessor": {
"$ref": "#/components/schemas/PreprocessorSavedFunctionId"
"$ref": "#/components/schemas/PreprocessorId"
},
"tool_functions": {
"type": [
Expand Down
25 changes: 17 additions & 8 deletions py/src/braintrust/_generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ class Organization(TypedDict):
"""


class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId(TypedDict):
class PreprocessorIdPreprocessorId(TypedDict):
type: Literal['function']
id: str
version: NotRequired[str | None]
Expand All @@ -1627,7 +1627,7 @@ class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId(TypedDict):
"""


class PreprocessorSavedFunctionIdPreprocessorSavedFunctionId1(TypedDict):
class PreprocessorIdPreprocessorId1(TypedDict):
type: Literal['global']
name: str
function_type: NotRequired[Literal['preprocessor'] | None]
Expand All @@ -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.
"""


Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions 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 e392acbca346c32a) -- do not modify"""
"""Auto-generated file (content hash 1b7d1d7656432f9e) -- do not modify"""

from ._generated_types import (
Acl,
Expand Down Expand Up @@ -67,7 +67,7 @@
Organization,
OrgAutomation,
Permission,
PreprocessorSavedFunctionId,
PreprocessorId,
Comment thread
AbhiPrasad marked this conversation as resolved.
Project,
ProjectAutomation,
ProjectGroup,
Expand Down Expand Up @@ -192,7 +192,7 @@
"OrgAutomation",
"Organization",
"Permission",
"PreprocessorSavedFunctionId",
"PreprocessorId",
"Project",
"ProjectAutomation",
"ProjectGroup",
Expand Down