diff --git a/pydantic_ai_slim/pydantic_ai/ui/_web/api.py b/pydantic_ai_slim/pydantic_ai/ui/_web/api.py index ac42fc529a..132827d248 100644 --- a/pydantic_ai_slim/pydantic_ai/ui/_web/api.py +++ b/pydantic_ai_slim/pydantic_ai/ui/_web/api.py @@ -152,7 +152,7 @@ async def health(request: Request) -> Response: async def post_chat(request: Request) -> Response: """Handle chat requests via Vercel AI Adapter.""" - adapter = await VercelAIAdapter[AgentDepsT, OutputDataT].from_request(request, agent=agent) + adapter = await VercelAIAdapter[AgentDepsT, OutputDataT].from_request(request, agent=agent, sdk_version=6) extra_data = ChatRequestExtra.model_validate(adapter.run_input.__pydantic_extra__) if error := validate_request_options(extra_data, model_ids, allowed_tool_ids): @@ -163,6 +163,7 @@ async def post_chat(request: Request) -> Response: streaming_response = await VercelAIAdapter[AgentDepsT, OutputDataT].dispatch_request( request, agent=agent, + sdk_version=6, model=model_ref, builtin_tools=request_builtin_tools, deps=deps, diff --git a/pydantic_ai_slim/pydantic_ai/ui/_web/app.py b/pydantic_ai_slim/pydantic_ai/ui/_web/app.py index aede5e5d7c..4591dcf5a2 100644 --- a/pydantic_ai_slim/pydantic_ai/ui/_web/app.py +++ b/pydantic_ai_slim/pydantic_ai/ui/_web/app.py @@ -25,7 +25,7 @@ 'you can use the `web` optional group — `pip install "pydantic-ai-slim[web]"`' ) from _import_error -CHAT_UI_VERSION = '1.0.0' +CHAT_UI_VERSION = '2.0.0' DEFAULT_HTML_URL = f'https://cdn.jsdelivr.net/npm/@pydantic/ai-chat-ui@{CHAT_UI_VERSION}/dist/index.html' AgentDepsT = TypeVar('AgentDepsT')