Skip to content

Add conditional tool enabling feature to agent as tool. #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thoo
Copy link
Contributor

@thoo thoo commented Jul 20, 2025

Summary

Adds is_enabled parameter to Agent.as_tool() method for conditionally enabling/disabling agent tools at runtime. Supports boolean values and callable functions for dynamic tool filtering
in multi-agent orchestration.

Test plan

  • Added unit tests in tests/test_agent_as_tool.py
  • Added example in examples/agent_patterns/agents_as_tools_conditional.py
  • Updated documentation in docs/tools.md
  • All tests pass

Issue number

Closes #1097

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

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.

Add is_enabled option to Agent as a tool pattern
1 participant