pypi pydantic-ai 2.70.0
v2.70.0 (2026-11-17)

50 minutes ago

What's Changed

⚠️ Compatibility Notes

  • Forward service_tier to xAI and record the served tier in provider_details by @dsfaccini in #13524
  • Add huggingface_logprobs and huggingface_top_logprobs to HuggingFaceModelSettings and return logprobs in provider_details by @LHMQ878 in #6855
  • Let Skills read a loaded skill's bundled files with read_files=True, and substitute ${SKILL_DIR} placeholders by @mpfaffenberger in #13678
  • Let a harness SpendLimits Budget resolve its usd/tokens ceiling per scope from the run context by @mpfaffenberger in #13644
  • [voice-authority] Add CapabilityPart, a request part for what a capability tells the model, rendered by the framework before any model sees it by @DouweM in #11935
  • Judge file input by media type with supported_image_media_types, supported_audio_media_types and supported_video_media_types by @DouweM in #12419
  • Skip node_modules, .venv and other package directories in RepoContext nested traversal with nested_exclude by @DouweM in #13103
  • Fix OpenAIChatModel sending Responses reasoning item ids as assistant-message fields in auto thinking mode by @pydanty in #12136
  • Run AnthropicModel's expired-container and stale-thinking-block retries for a status a retrying transport gave up on, and raise ModelHTTPError for one from OpenAIResponsesModel.compact_messages by @dsfaccini in #13571
  • Raise ModelRequestRejectedError before OpenAIChatModel sends tools to GPT-6 models with reasoning on by @pydanty in #12264
  • Fix Groq JSON output and reasoning flags, and raise UserError for NativeOutput with function tools on GroqModel by @pydanty in #12667
  • Run harness FileSystem and Shell tools on Azure Durable Task and Render by @mpfaffenberger in #12421
  • Fall back to 'auto' or raise ModelRequestRejectedError for forced tool choice on OpenRouter's qwen/qwen3.8-flash, which rejects forcing while reasoning by @pydanty in #12262
  • Re-run get_instructions and get_model_settings for the model that serves a ModelFallback attempt by @DouweM in #13679

🚀 Features

  • Forward service_tier to xAI and record the served tier in provider_details by @dsfaccini in #13524
  • Let PlaywrightBrowser provision its CDP endpoint per run and attach to the default context by @NickAnthony in #13555
  • Add huggingface_logprobs and huggingface_top_logprobs to HuggingFaceModelSettings and return logprobs in provider_details by @LHMQ878 in #6855
  • Let a parent check on a running background delegation with check_task and DelegationTasks.snapshot() by @mpfaffenberger in #13647
  • Let Skills read a loaded skill's bundled files with read_files=True, and substitute ${SKILL_DIR} placeholders by @mpfaffenberger in #13678
  • Add StreamGuardrail to screen each streamed text, thinking and tool-call part before the caller sees it by @mpfaffenberger in #13667
  • Let a harness SpendLimits Budget resolve its usd/tokens ceiling per scope from the run context by @mpfaffenberger in #13644
  • Add PruneToolResults so the model can replace a tool result it just received with a summary by @mpfaffenberger in #13634
  • Let PostgresMemoryStore prefix filters use an index, and keep nested scopes out of the Memory file listing with ChildListingMemoryStore by @mpfaffenberger in #13685
  • Resume a finished sub-agent task from message_task by @mpfaffenberger in #13672
  • Record each flagged PromptInjectionDefender verdict as a prompt_injection flagged span by @mpfaffenberger in #13736
  • Add SubAgent(on_model_error=) to choose retry or return for a failed sub-agent separately from on_failure by @mpfaffenberger in #13738
  • [voice-authority] Add CapabilityPart, a request part for what a capability tells the model, rendered by the framework before any model sees it by @DouweM in #11935
  • Add ToolSearch tools selector for pre-search deferral by @pydanty in #13139
  • Add register_workflows to Temporal AgentPlugin so activity-only workers can skip child workflow registration by @DouweM in #13338
  • Judge file input by media type with supported_image_media_types, supported_audio_media_types and supported_video_media_types by @DouweM in #12419
  • Add RetryOnModelErrors capability to retry the same model on transient model API errors by @DouweM in #11932
  • Skip node_modules, .venv and other package directories in RepoContext nested traversal with nested_exclude by @DouweM in #13103
  • Wait a model error's retry_after durably before retrying a model request on the AWS Lambda, Azure Durable Task, Absurd and pgtask durability capabilities by @DouweM in #13283
  • Add ToolDefinition.durable to run a tool outside its durable unit on every durable execution engine by @DouweM in #13214
  • Add OpenAI gpt-6.2-sol and gpt-6.2-astra model support by @dsfaccini in #13760
  • Give AgentRunError the failed run's conversation, and add capture_run_conversation(), so a failed turn can be stored by @DouweM in #12324

🐛 Bug Fixes

  • Fix OpenAIChatModel sending Responses reasoning item ids as assistant-message fields in auto thinking mode by @pydanty in #12136
  • End the ElevenLabs Agents response a malformed frame closes, instead of merging later replies into it by @dsfaccini in #13611
  • Run AnthropicModel's expired-container and stale-thinking-block retries for a status a retrying transport gave up on, and raise ModelHTTPError for one from OpenAIResponsesModel.compact_messages by @dsfaccini in #13571
  • Raise ModelRequestRejectedError before OpenAIChatModel sends tools to GPT-6 models with reasoning on by @pydanty in #12264
  • Turn the reasoning field of HuggingFaceModel responses into ThinkingParts by @pydanty in #10910
  • Price non-ASCII text and encoded runs conservatively in the harness compaction token estimate by @mpfaffenberger in #13620
  • Wait for a pending parallel InputGuardrail verdict before DetectLoops stops a streamed request, and check long parts in linear time by @mpfaffenberger in #13682
  • Fix Groq JSON output and reasoning flags, and raise UserError for NativeOutput with function tools on GroqModel by @pydanty in #12667
  • Check model-written pin(source='model') bodies for lookalike frames by @mpfaffenberger in #13630
  • Run harness FileSystem and Shell tools on Azure Durable Task and Render by @mpfaffenberger in #12421
  • Spill each ToolOutputLimits call separately when one run reuses a tool_call_id by @gouyu-hou in #12677
  • Read PydanticAIDocs remote pages at the installed pydantic_ai release tag instead of main by @mpfaffenberger in #13737
  • Fall back to 'auto' or raise ModelRequestRejectedError for forced tool choice on OpenRouter's qwen/qwen3.8-flash, which rejects forcing while reasoning by @pydanty in #12262
  • Preserve Cohere tool_plan in message history and replay it on follow-up requests by @pydanty in #13148
  • Accept any task ID in DelegationTasks.save when the owner has no directory by @DouweM in #13418
  • Re-run get_instructions and get_model_settings for the model that serves a ModelFallback attempt by @DouweM in #13679
  • Cache uploaded documents per XaiModel instance by @pydanty in #12485
  • Fix xAI DocumentUrl upload file names using downloaded media type extensions by @pydanty in #12369
  • Raise IncompleteToolCall right away when the token limit cuts off an output tool call, instead of retrying by @DouweM in #13125
  • Answer tool results and end the response after an unreadable or id-less OpenAI Realtime response.done by @dsfaccini in #13701
  • Drop stop_sequences with a warning on Bedrock Converse models that reject it by @DouweM in #13762
  • List valid ids for unknown load_capability ids and make loads of already-active capabilities a no-op by @Naeemeh146 in #11937
  • Include docstring admonition sections and whole annotated Returns sections in tool descriptions by @pydanty in #12548
  • Make the CodeMode speculation scan of streamed code linear in its length by @dsfaccini in #13697
  • Drain the start-up readiness waiter inside the try, so a cancelled run on Python 3.11 doesn't leave its wrap_run task pending by @DouweM in #13725
  • Replay every input field of Anthropic tool search calls, so thinking after a search stays valid by @DouweM in #13763
  • Send a tool-returned video on OpenRouter only to models whose profile reads video, so the rest get a note instead of a 404 by @DouweM in #13219

📦 Dependencies

  • Cap provider SDK extras below the next major we haven't tested by @DouweM in #13316

New Contributors

Full Changelog: v2.69.0...v2.70.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.