Skip to content

Conversation

@sordonia
Copy link
Member

@sordonia sordonia commented Jul 2, 2025

  • adds agent as tool capability

@sordonia sordonia requested review from MarcCote and Copilot July 7, 2025 01:46
Copy link
Contributor

Copilot AI left a 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_choice via kwargs in openai.py
  • Split and rename LLM instantiation into instantiate_from_config and a new instantiate in base.py
  • Add AgentTool for 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 generate should be updated to document the new tool_choice parameter so users know they can override it via kwargs.
    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 for use, __copy__, and __deepcopy__ behaviors to ensure correct functionality.
@Toolbox.register()

Alessandro Sordoni and others added 8 commits July 6, 2025 18:48
@xingdi-eric-yuan
Copy link
Collaborator

I feel the agentic_tool can be something more generic, and this history summarization tool being an instantiation of such class?

@sordonia
Copy link
Member Author

sordonia commented Jul 8, 2025

I feel the agentic_tool can be something more generic, and this history summarization tool being an instantiation of such class?

what do you have in mind? @xingdi-eric-yuan there's no history summarization here

Copy link
Collaborator

@xingdi-eric-yuan xingdi-eric-yuan left a 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.

Copy link
Collaborator

@MarcCote MarcCote left a 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
Copy link
Collaborator

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?

Copy link
Member Author

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

Copy link
Collaborator

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?

matheper and others added 2 commits July 9, 2025 15:54
Co-authored-by: Marc-Alexandre Côté <marc.cote.19@gmail.com>
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.

4 participants