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
94 changes: 94 additions & 0 deletions generated_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -5024,6 +5024,36 @@
}
]
},
"NamedScore": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"score": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1
},
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"metadata": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"name"
]
},
"NullableSavedFunctionId": {
"anyOf": [
{
Expand Down Expand Up @@ -8125,6 +8155,70 @@
}
]
},
"ScoreObject": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The score name. Defaults to the function name for a single score."
},
"score": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1
},
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"metadata": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"score"
]
},
"ScoreResult": {
"anyOf": [
{
"$ref": "#/components/schemas/ScoreObject"
},
{
"$ref": "#/components/schemas/NamedScore"
},
{
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1
},
{
"type": "boolean"
}
]
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/NamedScore"
},
"description": "Multiple scores. Each score must have a unique name."
},
{
"type": "null"
}
],
"description": "The return value of a scorer function."
},
"ServiceToken": {
"type": "object",
"properties": {
Expand Down
23 changes: 23 additions & 0 deletions py/src/braintrust/_generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,12 @@ class ModelParamsModelParams4(TypedDict):
reasoning_budget: NotRequired[float | None]


class NamedScore(TypedDict):
name: str
score: NotRequired[float | bool | None]
metadata: NotRequired[Mapping[str, Any] | None]


class NullableSavedFunctionIdNullableSavedFunctionId(TypedDict):
type: Literal['function']
id: str
Expand Down Expand Up @@ -2482,6 +2488,23 @@ class SavedFunctionIdSavedFunctionId1(TypedDict):
)


class ScoreObject(TypedDict):
name: NotRequired[str | None]
"""
The score name. Defaults to the function name for a single score.
"""
score: float | bool | None
metadata: NotRequired[Mapping[str, Any] | None]


ScoreResult: TypeAlias = (
ScoreObject | NamedScore | float | bool | Sequence[NamedScore] | None
)
"""
The return value of a scorer function.
"""


class ServiceToken(TypedDict):
id: str
"""
Expand Down
8 changes: 7 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 719572142fc24803) -- do not modify"""
"""Auto-generated file (content hash 52c1e6b1a10f5644) -- do not modify"""

from ._generated_types import (
Acl,
Expand Down Expand Up @@ -60,6 +60,7 @@
MCPServer,
MessageRole,
ModelParams,
NamedScore,
NullableSavedFunctionId,
ObjectReference,
ObjectReferenceNullish,
Expand Down Expand Up @@ -97,6 +98,8 @@
Role,
RunEval,
SavedFunctionId,
ScoreObject,
ScoreResult,
ServiceToken,
SpanAttributes,
SpanIFrame,
Expand Down Expand Up @@ -185,6 +188,7 @@
"MCPServer",
"MessageRole",
"ModelParams",
"NamedScore",
"NullableSavedFunctionId",
"ObjectReference",
"ObjectReferenceNullish",
Expand Down Expand Up @@ -224,6 +228,8 @@
"SSEConsoleEventData",
"SSEProgressEventData",
"SavedFunctionId",
"ScoreObject",
"ScoreResult",
"ServiceToken",
"SpanAttributes",
"SpanIFrame",
Expand Down