Skip to content

Add prepare_model_settings hook#2

Draft
dsfaccini wants to merge 3 commits intodsfaccini:tool-choicefrom
pydantic:prepare-model-settings
Draft

Add prepare_model_settings hook#2
dsfaccini wants to merge 3 commits intodsfaccini:tool-choicefrom
pydantic:prepare-model-settings

Conversation

@dsfaccini
Copy link
Copy Markdown
Owner

  • Closes #

Pre-Review 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.
  • Linting and type checking pass per make format and make typecheck.
  • PR title is fit for the release changelog.

Pre-Merge Checklist

  • New tests for any fix or new behavior, maintaining 100% coverage.
  • Updated documentation for new features and behaviors, including docstrings for API docs.

@DouweM
Copy link
Copy Markdown

DouweM commented Jan 9, 2026

@dsfaccini Btw I'm thinking that instead of making this a prepare hook, it makes more sense to have model_settings on Agent and agent.run accept a callable that receives the runcontext, as an alternative to a plain ModelSettings dict. That's consistent with the other things that are dynamic per run step, like instructions and metadata (both arguments take callables too). We only really need a prepare hook for tools, as that doesn't dynamically determine the result, but dynamically modify the already-registered tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants