-
Notifications
You must be signed in to change notification settings - Fork 36
Agent as tool #169
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
base: main
Are you sure you want to change the base?
Agent as tool #169
Conversation
sordonia
commented
Jul 2, 2025
- adds agent as tool capability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds agent-as-tool support by exposing tool choice in the OpenAI wrapper, refactoring LLM instantiation pathways, and introducing a new AgentTool.
- Allow passing
tool_choiceviakwargsinopenai.py - Split and rename LLM instantiation into
instantiate_from_configand a newinstantiateinbase.py - Add
AgentToolfor querying a specialized LLM agent
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| debug_gym/llms/openai.py | Make tool_choice configurable via kwargs.pop |
| debug_gym/llms/base.py | Refactor instantiate methods, rename one to instantiate_from_config |
| debug_gym/gym/tools/agent.py | New AgentTool class for agent-as-tool capability |
Comments suppressed due to low confidence (2)
debug_gym/llms/openai.py:185
- [nitpick] The docstring for
generateshould be updated to document the newtool_choiceparameter so users know they can override it viakwargs.
def generate(self, messages, tools, **kwargs) -> LLMResponse:
debug_gym/gym/tools/agent.py:13
- [nitpick] No unit tests were added for
AgentTool. Consider adding tests foruse,__copy__, and__deepcopy__behaviors to ensure correct functionality.
@Toolbox.register()
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…o as/agent_as_tool
|
I feel the |
what do you have in mind? @xingdi-eric-yuan there's no history summarization here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to have some documentation/instruction on how to use this tool? But it can also be in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment to be addressed before merging.
| } | ||
|
|
||
| def __init__( | ||
| self, history, llm_name=None, llm_config=None, llm_config_file_path=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this history? A reference to an agent's history?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the HistoryTracker of the caller agent, the agentic tool might want to peek at the interactions of the caller agent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But do you have an example of how it is use?
Co-authored-by: Marc-Alexandre Côté <marc.cote.19@gmail.com>