Skip to content
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

fix(agent): optimize of base agent #2276

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

cinjoseph
Copy link
Contributor

@cinjoseph cinjoseph commented Jan 6, 2025

Description

  1. optimize the content format for the agent's memory access. Previously, the Agent's memory stored check_fail_reason as an action. However, check_fail_reason is more like an observation.
  2. ConversableAgent add name prefix, To confirm which APP an Agent originates from in a cascading app scenario
  3. Conversable supports the force_retry option. The force_retry allows users to control the next action within the act method, thereby implementing the REACT.
  4. optimize the tool_assistant_agent. Make mach clearer of the prompts for ToolAction. and add the dynamic description of ToolAssistantAgent
  5. implement function get_last_message in DefaultGptsMessageMemeory

How Has This Been Tested?

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added agent Module: agent fix Bug fixes labels Jan 6, 2025
@cinjoseph cinjoseph force-pushed the Optimize_of_base_agent branch from 6363145 to e920421 Compare January 6, 2025 06:37
yhjun1026
yhjun1026 previously approved these changes Jan 9, 2025
Copy link
Collaborator

@yhjun1026 yhjun1026 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@yhjun1026
Copy link
Collaborator

ConversableAgent add name prefix, To confirm which APP an Agent originates from in a cascading app scenario。There are some questions about this modification. Agents can overload and define their own names. In theory, there is no need to add name processing including prefixes to the base class.

@cinjoseph
Copy link
Contributor Author

@yhjun1026 I think the current design is based on the assumption that there is only one of each type of Agent within the same context. In my current scenario, one app can call another app, and if both apps contain the same type of Agent, I won't be able to distinguish which app an Agent comes from in places where the Agent name is displayed. I think that Agent names shouldn't be fixed or directly tied to their Roles. The Role only represents their species, but there are many different individuals within a species. It's like how we are all humans (Role), yet we have different names.

@property
def name(self) -> str:
"""Return the name of the agent."""
if self.name_prefix is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is different to understand. Maybe it's better to use . or - such as:
Report.ChatReport or Report-ChatReport?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Module: agent fix Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants