Skip to content

feat: add builtin tools override#5248

Merged
DouweM merged 2 commits intopydantic:mainfrom
mplemay:test-builtins
Apr 29, 2026
Merged

feat: add builtin tools override#5248
DouweM merged 2 commits intopydantic:mainfrom
mplemay:test-builtins

Conversation

@mplemay
Copy link
Copy Markdown
Contributor

@mplemay mplemay commented Apr 29, 2026

Adds builtin_tools support to Agent.override(...), allowing tests to temporarily replace or remove agent-configured built-in tools without mutating private attributes. This lets agents configured with provider-executed built-ins run cleanly with TestModel via agent.override(model=TestModel(), builtin_tools=[]), while preserving existing additive run(..., builtin_tools=...) behavior.

Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • PR title is fit for the release changelog.

@github-actions github-actions Bot added size: S Small PR (≤100 weighted lines) feature New feature request, or PR implementing a feature (enhancement) labels Apr 29, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@DouweM
Copy link
Copy Markdown
Collaborator

DouweM commented Apr 29, 2026

@mplemay Thanks, the fix is sound! You may also want to have look at provider-adaptive capabilities as an alternative to builtin tools, that do work with TestModel and other providers that don't support a given builtin tool: https://pydantic.dev/docs/ai/core-concepts/capabilities/#provider-adaptive-tools

@DouweM DouweM merged commit 6298abd into pydantic:main Apr 29, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature request, or PR implementing a feature (enhancement) size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants