Skip to content

Commit 0701b22

Browse files
committed
bit of docs
1 parent 025f1b5 commit 0701b22

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/ui/web.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ agent = Agent('openai:gpt-5')
6666
def get_weather(city: str) -> str:
6767
return f'The weather in {city} is sunny'
6868

69-
# Create app with model names (display names auto-generated)
69+
# Create app with model names (their display names are auto-generated)
7070
app = agent.to_web(
7171
models=['openai:gpt-5', 'anthropic:claude-sonnet-4-5'],
7272
builtin_tools=[WebSearchTool()],

pydantic_ai_slim/pydantic_ai/ui/_web/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ class _ChatRequestExtra(BaseModel, extra='ignore', alias_generator=to_camel):
4949
"""Extra data extracted from chat request."""
5050

5151
model: str | None = None
52+
"""Model ID selected by the user, e.g. 'openai:gpt-5'. Maps to JSON field 'model'."""
5253
builtin_tools: list[str] = []
54+
"""Tool IDs selected by the user, e.g. ['web_search', 'code_execution']. Maps to JSON field 'builtinTools'."""
5355

5456

5557
def add_api_routes(
@@ -80,7 +82,7 @@ async def configure_frontend(request: Request) -> Response:
8082
"""Endpoint to configure the frontend with available models and tools."""
8183
config = _ConfigureFrontend(
8284
models=_models,
83-
builtin_tools=[BuiltinToolInfo(id=tool.kind, name=tool.label) for tool in _builtin_tools],
85+
builtin_tools=[BuiltinToolInfo(id=tool.unique_id, name=tool.label) for tool in _builtin_tools],
8486
)
8587
return JSONResponse(config.model_dump(by_alias=True))
8688

0 commit comments

Comments
 (0)