prepare_tools
param to Agent class by @rmaceissoft in #1474GoogleModel
by @Kludex in #1780prepare_tools
to _prepare_tools
by @Kludex in #1789Agent.to_cli()
by @Kludex in #1791'openrouter'
string to OpenAIModel
provider param by @Kludex in #1792capabilities
required on AgentCard
by @Kludex in #1733include_binary_content
flag to InstrumentationSettings
, rename OTel attribute key from content
to binary_content
for BinaryPart
s by @alexmojaki in #1739vendor_id
to the model response. by @peterHoburg in #1547clai
should not require OPENAI_API_KEY
by @samuelcolvin in #1724sys.path
by @Kludex in #1703include_metadata
and include_expected_output
by @lionpeloux in #1700direct
public API by @samuelcolvin in #1599to_cli()
method to Agent
by @AndrewHannigan in #1642~/.pydantic-ai
by @Kludex in #1701BinaryContent
information by @Kludex in #1603See ###1647 — usage makes sense as part of ModelResponse
, and could be really useful in "messages" (really a sequence of requests and response). In this PR:
usage
to ModelResponse
(field has a default factory of Usage()
so it'll work to load data that doesn't have usage)Model.request
to just ModelResponse
instead of tuple[ModelResponse, Usage]
ToolCallPartDelta.tool_call_id
when known from previous delta by @DouweM in #1694clai
by @samuelcolvin in #1504temperature
to 0 on BedrockConverseModel
by @pandersen-uncharted in #1631extra_headers
to ModelSettings
by @ramanan-ravi in #1644thinking_config
to GeminiModel
by @Kludex in #1609HandleResponseEvent
by @DouweM in #1619base_url
to Mistral Provider by @alibeyram in #1617use_attribute_docstrings=True
by default on tools by @Kludex in #1605report_case_name
in span by @alexmojaki in #1544list
type inside the Annotated
on function_declarations
field by @gitraffe in #1570prepare_env.py
to Python file in mcp-run-python
by @samuelcolvin in #1461instructions
by @Kludex in #1529extra_body
to ModelSettings
by @Kludex in #1538BinaryContent
in message_history
by @arde100 in #1523BinaryContent
by decoding base64
by @DouweM in #1513StdioServerParameters.cwd
param by @timesler in #1514UserPromptNode
by @Kludex in #1503additionalProperties
by gemini by @Kludex in #1506BedrockConverseModel
by @leandrodamascena in #1435result
-> output
by @samuelcolvin in #1248BedrockConverseModel
): add additional configuration fields to Bedrock Runtime API by @leandrodamascena in #1458gemini-2.5-pro-preview-03-25
model (paid version of gemini 2.5 pro) by @barapa in #1473format_as_xml
by @samuelcolvin in #1484instructions
parameter by @Kludex in #1360user_prompt
optional by @Kludex in #1406stop_sequences
to ModelSettings
by @Kludex in #1419handle_stream.stream_output()
in the CLI by @Kludex in #1376mcp-run-python
server to use deno by @samuelcolvin in #1340exclusiveMaximum
/exclusiveMinimum
from Gemini by @Kludex in #1341generate_summary
and truncation
to OpenAIResponsesModelSettings
by @Kludex in #1328ImageUrl
and DocumentUrl
for Anthropic Models by @jnishiyama in #1318pydantic-evals
package by @dmontagu in #935PYTHONOPTIMIZE=1
by @Kludex in #1307headers
, timeout
, and sse_read_timeout
to MCPServerHTTP
by @JohnUiterwyk in #1218get_running_loop
instead of get_event_loop
" by @Kludex in #1252user
mapping in openai chat completion by @ovisek in #1174max_tokens
to max_completion_tokens
by @barapa in #1206model_request_parameters
attribute (containing tool definitions) to chat spans by @alexmojaki in #1177get_running_loop
instead of get_event_loop
by @Kludex in #1204pydantic-ai-slim
version on CLI instead of pydantic-ai
by @samuelcolvin in #1213system
parameter from OpenAIModel
by @Kludex in #1235SystemPromptPart
by @vricciardulli in #1154MCPServerSSE
to MCPServerHTTP
and more docs by @samuelcolvin in #1176OpenAIProvider
to use environment variable for base URL by @hrahmadi71 in #1117AzureProvider
by @Kludex in #1091InstrumentedModel
and FallbackModel
fixes by @alexmojaki in #1121DocumentUrl
and support document via BinaryContent
by @Kludex in #987base_url
to models, populate server.address
and server.port
in spans by @alexmojaki in #1074This release only makes sure that pydantic-ai-examples
have the right dependency versions.
Agent.instrument_all()
method to instrument all agents by default by @alexmojaki in #1047pai
CLI by @Kludex in #1031instrument
param to Agent
, use plain OpenTelemetry by @alexmojaki in #1005gemini-2.0-pro-exp-02-05
by @barapa in #1038return_type
by @Kludex in #1017model request
span with InstrumentedModel
by @alexmojaki in #1012all_messages
in agent span with all_messages_events
in same format as InstrumentedModel
span by @alexmojaki in #1018.iter()
API to fully replace existing streaming implementation by @dmontagu in #951TestModel
by @Kludex in #1015max_results
parameter to DuckDuckGo search tool by @HamzaFarhan in #1003ImageUrl
by @pedroallenrevez in #993FallbackModel
support by @sydney-runkle in #894InstrumentedModel
by @alexmojaki in #892name
methods from openai and mistral models by @sydney-runkle in #925request_stream
to InstrumentedModel
by @alexmojaki in #922next
more ergonomic by @dmontagu in #833InstrumentedModel
by @alexmojaki in #945async
from _get_model
by @alexmojaki in #893ModelResponse.model_name
from responses by @alexmojaki in #883o3
support for OpenAIModel
by @sydney-runkle in #853AgentModel
class by @dmontagu in #800reasoning_effort
param for OpenAIModel
by @sydney-runkle in #854project_id == creds_id
check for vertexai by @sydney-runkle in #862model_name
and system
model properties by @sydney-runkle in #865pydantic_ai.Agent
to using pydantic_graph
by @dmontagu in #725tool_call_id
to chatbot.append if it's set by @chug2k in #771AgentDeps
refs to AgentDepsT
by @zzstoatzz in #767ModelSettings
to support specialized model requests by @sydney-runkle in #766_utils.Either
by @dmontagu in #768docstring_format
and require_parameter_descriptions
by @chris-dare in #776OllamaModel
in favor of usage with OpenAIModel
by @sydney-runkle in #805Cohere
docs and additional (live) tests by @sydney-runkle in #810allow_model_requests
check by @YanSte in #697model_name
to ModelResponse
by @sydney-runkle in #701'deepseek-r1'
to the list of Ollama Model Names by @izzyacademy in #735o1
by @sydney-runkle in #740from_text
and from_tool_call
utilities that complicate snapshot testing by @sydney-runkle in #744IsNow()
delta by @dmontagu in #746set_event_loop
fixture by @dmontagu in #747parallel_tool_calls
in ModelSettings
by @sydney-runkle in #750user
role system prompts o1-preview-2024-09-12
by @siavashg in #754asyncio
to all examples that need it. by @ME-Msc in #638docstring_format
and require_parameter_descriptions
on tools by @sydney-runkle in #643phi4
to Ollama by @josead in #668run
/ run_sync
docs by @KranthiGV in #688testing-evals
and RAG example by @lealre in #694UV_FROZEN
globally in CI by @samuelcolvin in #626dynamic
to system_prompt
decorator, allowing reevaluation by @josead in #560--reinstall
instead of uninstall/install for docs insiders packages by @T-256 in #627result_type
on a run by @samuelcolvin in #629scope
to google.auth.default()
by @jtbaker in #579AgentDeps
default to None
. by @samuelcolvin in #592X | None = None
with Gemini by @samuelcolvin in #540chat_app
example by @DurandA in #553RunContext
by @samuelcolvin in #570capture_run_messages
support nested agent calls by @samuelcolvin in #573TestModel
handles result retries correctly by @jlowin in #572ResultData
, some related cleanup by @samuelcolvin in #512Agents
page by @lealre in #521last_run_messages
, add capture_run_messages
by @samuelcolvin in #536ModelMessage
discriminator in chat_app example by @DurandA in #402Cost
to Usage
by @dmontagu in #403openai:o1
model support by @sydney-runkle in #498RunContext
more widely by @samuelcolvin in #500All releases prior to V1 can contain breaking changes according to semvar, but this release contains more than usual:
ToolReturnPart
for each tool call, see #184 and #274tests/test_tools.py
by @samuelcolvin in #229uv
version by @zzstoatzz in #236ModelSettings
logic by @sydney-runkle in #227messages.py
by @sydney-runkle in #255defer_build
with type adapters, not custom _LazyTypeAdapter
by @sydney-runkle in #253isinstance
checks for message kinds by @sydney-runkle in #252messages
to RunContext
by @samuelcolvin in #257list[ModelRequest | ModelResponse]
by @samuelcolvin in #259.stream_text(delta=True)
by @samuelcolvin in #178IndexError
when streaming OpenAI
by @samuelcolvin in #181Agent.name
by @samuelcolvin in #141bank_support.py
-- fix docstring typo by @akgerber in #143logfire
optional group by @samuelcolvin in #154nee
-> need
by @patrick91 in #111.vscode/
to .gitignore
by @zzstoatzz in #113Agent(tools_[...])
by @samuelcolvin in #128retreiver
to tool
by @samuelcolvin in #96CallContext
-> RunContext
by @samuelcolvin in #101pydantic-ai-slim
only by @samuelcolvin in #103test-live
by @samuelcolvin in #90infer_model
by @samuelcolvin in #89pydantic-ai-slim
by @samuelcolvin in #92retriever_context
-> retriever
by @samuelcolvin in #68shared.py
by @samuelcolvin in #29ToolCall
to Structured
in most places by @samuelcolvin in #34ResultData
, rename method/attributes appropriately by @samuelcolvin in #36Either
from _handle_model_response
and _handle_streamed_model_response
by @samuelcolvin in #39Agent
initialization to take deps type, not deps by @samuelcolvin in #40TypeAliasType
unions by @samuelcolvin in #26initial release 🎉