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: forward kwargs to conversable agent + fix typing #1193

Merged
merged 3 commits into from
Jan 13, 2024

Conversation

joseferben
Copy link
Contributor

@joseferben joseferben commented Jan 10, 2024

Why are these changes needed?

Agent descriptions should be supported by CompressibleAgent.

This change makes CompressibleAgent behave as it's stated in its documentation, where it says that the kwargs of ConversableAgent are supported.

Also new CompressibleAgent(description="some description") gives a type error, because description is not an explicit argument of the constructor.

Checks

Copy link
Collaborator

@joshkyh joshkyh left a comment

Choose a reason for hiding this comment

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

Thank you. Any chance you can add two unit tests to https://github.com/microsoft/autogen/blob/main/test/agentchat/contrib/test_compressible_agent.py?

  1. Verifies the use of the description parameter when it is supplied.
  2. Verifies one example kwarg when it is supplied.

@joseferben
Copy link
Contributor Author

@microsoft-github-policy-service agree company="beeps"

@joseferben
Copy link
Contributor Author

joseferben commented Jan 11, 2024

@joshkyh Thanks for the review. I added one test, I can't really test the kwargs in a sensible way atm because all the arguments of CompressibleAgent are also the arguments of ConversableAgent.

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b548e55) 30.38% compared to head (1cca889) 56.85%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1193       +/-   ##
===========================================
+ Coverage   30.38%   56.85%   +26.47%     
===========================================
  Files          32       32               
  Lines        4302     4680      +378     
  Branches      994     1243      +249     
===========================================
+ Hits         1307     2661     +1354     
+ Misses       2901     1771     -1130     
- Partials       94      248      +154     
Flag Coverage Δ
unittests 56.60% <ø> (+26.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@joshkyh joshkyh left a comment

Choose a reason for hiding this comment

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

Thanks!
Can you also add
description (str): a short description of the agent. This description is used by other agents (e.g. the GroupChatManager) to decide when to call upon this agent. (Default: system_message) to the docstring?
I copied this from
https://github.com/microsoft/autogen/blob/71fc6e8952c31ea1492252247698f34419efc08f/autogen/agentchat/conversable_agent.py

@joseferben
Copy link
Contributor Author

@joshkyh done

Copy link
Collaborator

@joshkyh joshkyh left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

@sonichi sonichi added this pull request to the merge queue Jan 13, 2024
Merged via the queue into microsoft:main with commit 4426093 Jan 13, 2024
81 of 84 checks passed
joshkyh pushed a commit that referenced this pull request Jan 17, 2024
* fix: forwards kwargs to conversable agent + typing

* add description unit test

* add documentation for description
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* fix: forwards kwargs to conversable agent + typing

* add description unit test

* add documentation for description
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