-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
Function calling seems to be working in general, however when there is a structured output_type the AG-UI client doesn't seem to return the corresponding tool_call_response while using the handle_ag_ui_request function.
Using logfire I could see that the tool_call_response was generated in the response, but when the request is being built the tool_call_response message part is missing.
Example Code
from enum import Enum
from pydantic_ai import Agent
from pydantic_ai.ag_ui import handle_ag_ui_request
from starlette.requests import Request
class output_type(Enum):
A = "a"
B = "b"
agent = Agent(
output_type=output_type
)
async def agent_endpoint(request: Request):
return await handle_ag_ui_request(agent, request)Python, Pydantic AI & LLM client version
python 3.11, pydantic-ai-slim==1.0.10, LLM client is OpenAI (Azure) with openai==1.109.1