Skip to content

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Jun 3, 2025

Summary:

Allows a user to do function_tool(is_enabled=<some_callable>); the callable is called when the agent runs.

This allows you to dynamically enable/disable a tool based on the context/env.

The meta-goal is to allow Agent to be effectively immutable. That enables some nice things down the line, and this allows you to dynamically modify the tools list without mutating the agent.

Test Plan:

Unit tests

towards #767

### Summary:
Allows a user to do `function_tool(is_enabled=<some_callable>)`; the callable is called when the agent runs.

This allows you to dynamically enable/disable a tool based on the context/env.
### Test Plan:
Unit tests
@rm-openai rm-openai merged commit 4046fcb into main Jun 3, 2025
10 checks passed
@rm-openai rm-openai deleted the rm/pr808 branch June 3, 2025 17:44
KatHaruto pushed a commit to KatHaruto/openai-agents-python that referenced this pull request Jun 10, 2025
### Summary:
Allows a user to do `function_tool(is_enabled=<some_callable>)`; the
callable is called when the agent runs.

This allows you to dynamically enable/disable a tool based on the
context/env.

The meta-goal is to allow `Agent` to be effectively immutable. That
enables some nice things down the line, and this allows you to
dynamically modify the tools list without mutating the agent.

### Test Plan:
Unit tests
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