API Reference
Classes:
Name | Description |
---|---|
PydanticAIAgent |
Adapter class to wrap a Pydantic AI Agent for use with FastAPIAgents and resolve runtime dependencies. |
PydanticAIAgent
Adapter class to wrap a Pydantic AI Agent for use with FastAPIAgents and resolve runtime dependencies.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent
|
Agent
|
The Pydantic AI Agent with |
required |
deps
|
Optional[Callable[[], Any]]
|
Optional function to resolve runtime dependencies. |
None
|
Example:
from fastapi_agents.pydantic_ai import PydanticAIAgent
from pydantic_ai import Agent
agent = Agent("openai:gpt-4o-mini")
pydantic_ai_agent = PydanticAIAgent(agent)
Raises:
Type | Description |
---|---|
ValueError
|
If the agent has |
ValueError
|
If the agent does not have |
Returns:
Name | Type | Description |
---|---|---|
PydanticAIAgent |
A Pydantic AI Agent with runtime dependency resolution. |