Skip to content
Open
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
18 changes: 18 additions & 0 deletions generated_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,15 @@
"high"
]
},
"chat_template_kwargs": {
"type": "object",
"properties": {
"enable_thinking": {
"type": "boolean"
}
},
"additionalProperties": {}
},
"verbosity": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -4963,6 +4972,15 @@
"high"
]
},
"chat_template_kwargs": {
"type": "object",
"properties": {
"enable_thinking": {
"type": "boolean"
}
},
"additionalProperties": {}
},
"verbosity": {
"type": "string",
"enum": [
Expand Down
10 changes: 10 additions & 0 deletions py/src/braintrust/_generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ class AnyModelParamsFunctionCall(TypedDict):
name: str


class AnyModelParamsChatTemplateKwargs(TypedDict):
enable_thinking: NotRequired[bool | None]
Comment on lines +121 to +122

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve arbitrary chat-template keyword arguments

When a caller passes a provider-specific chat-template option other than enable_thinking (for example, {"chat_template_kwargs": {"foo": "bar"}}), static type checkers reject the value because this TypedDict is closed. The generated schema for this field explicitly has additionalProperties: {}, so arbitrary keys are valid and PromptBuilder.create() forwards params unchanged; type it as a mapping that retains enable_thinking or otherwise permits additional keys.

Useful? React with 👍 / 👎.



class ApiKey(TypedDict):
id: str
"""
Expand Down Expand Up @@ -1485,6 +1489,10 @@ class ModelParamsModelParamsFunctionCall(TypedDict):
name: str


class ModelParamsModelParamsChatTemplateKwargs(TypedDict):
enable_thinking: NotRequired[bool | None]


class ModelParamsModelParams1(TypedDict):
use_cache: NotRequired[bool | None]
reasoning_enabled: NotRequired[bool | None]
Expand Down Expand Up @@ -3294,6 +3302,7 @@ class AnyModelParams(TypedDict):
n: NotRequired[float | None]
stop: NotRequired[Sequence[str] | None]
reasoning_effort: NotRequired[Literal['none', 'minimal', 'low', 'medium', 'high'] | None]
chat_template_kwargs: NotRequired[AnyModelParamsChatTemplateKwargs | None]
verbosity: NotRequired[Literal['low', 'medium', 'high'] | None]
top_k: NotRequired[float | None]
stop_sequences: NotRequired[Sequence[str] | None]
Expand Down Expand Up @@ -3697,6 +3706,7 @@ class ModelParamsModelParams(TypedDict):
n: NotRequired[float | None]
stop: NotRequired[Sequence[str] | None]
reasoning_effort: NotRequired[Literal['none', 'minimal', 'low', 'medium', 'high'] | None]
chat_template_kwargs: NotRequired[ModelParamsModelParamsChatTemplateKwargs | None]
verbosity: NotRequired[Literal['low', 'medium', 'high'] | None]


Expand Down
2 changes: 1 addition & 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 3afaef2c77c574a6) -- do not modify"""
"""Auto-generated file (content hash 43fa4b11de97efd6) -- do not modify"""

from ._generated_types import (
Acl,
Expand Down
Loading