-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bugReport that something isn't working, or PR implementing a fixReport that something isn't working, or PR implementing a fix
Description
Initial Checks
- I'm using the latest version of Pydantic AI
- I've searched for my issue in the issue tracker before opening this issue
Description
The max_retries parameter from the ToolOutput class is never used. Initialization happens via the OutputToolset.build class method that returns an OutputToolset object with max_retries set to the default value of 1.
See
| return cls(processors=processors, tool_defs=tool_defs) |
| max_retries: int = 1, |
Minimal, Reproducible Example
import os
os.environ["OPENAI_API_KEY"] = "XXXXX"
from pydantic import BaseModel
from pydantic_ai import Agent
from pydantic_ai.output import ToolOutput
class Foo(BaseModel):
bar: str
agent = Agent(
"openai:gpt-5.2",
output_type=ToolOutput(Foo, max_retries=3)
)
print(agent.toolsets[0].output_schema.toolset.max_retries)
#> 1Logfire Trace
No response
Python, Pydantic AI & LLM client version
- Python:
- Pydantic AI:
- LLM provider SDK:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugReport that something isn't working, or PR implementing a fixReport that something isn't working, or PR implementing a fix