-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Improve command system; add aliases for commands #2635
Improve command system; add aliases for commands #2635
Conversation
this PR Extended Command Features. please review. #2635 |
d94ad20
to
22fc932
Compare
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)autogpt/commands/command.py
autogpt/commands/google_search.py
autogpt/commands/file_operations.py
|
@Pwuts @nponeccop Today I found I used the company email to submit the PR, now I changed to my personal email and resubmitted. |
@BillSchumacher please review this PR, and #2311 |
This is a mass message from the AutoGPT core team. For more details (and for infor on joining our Discord), please refer to: |
indeed, the idea looks much better than hard-coding aliases into app.py (see map_command_synonyms there) |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
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.
Interesting feature. Thanks for submitting.
It would be good to have benchmarks in place to prevent any confusion with the LLM and ensure that it doesn't consume an excessive amount of the context window. Additionally, it would be good to consider the synonyms feature. Lastly, for future ref: there were some variable renames that were unnecessary and not relevant to this particular feature.
Please resolve conflicts and thanks again for submitting!
✅ Deploy Preview for auto-gpt-docs canceled.
|
3b9f221
to
1633924
Compare
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2635 +/- ##
==========================================
+ Coverage 50.29% 50.52% +0.22%
==========================================
Files 116 116
Lines 4843 4857 +14
Branches 653 655 +2
==========================================
+ Hits 2436 2454 +18
+ Misses 2221 2219 -2
+ Partials 186 184 -2
☔ View full report in Codecov by Sentry. |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
…s#2635) * Command name supports multiple names * Separate CommandRegistry.commands and .command_aliases * Update test_commands.py * Add __contains__ operator to CommandRegistry * Update error message for unknown commands --------- Co-authored-by: Reinier van der Leer <[email protected]>
Background
The AI will regularly hallucinate command names. By providing probable synonyms (aliases) for existing commands, we can prevent failure in such cases.
Before:
Now:
write_to_file
,write_file
, andcreate_file
will all take effect.Changes
CommandRegistry
__contains__()
method to support checkingcommand_name in registry
commands_aliases
to map aliases to commands inget_command()
,call()
and__contains__()
unregister()
now takes aCommand
as its argument instead ofstr
get_command()
now returnsNone
if a command does not exist, instead of aKeyError
PromptGenerator
CommandRegistry
args
->params
app.py::execute_command()
CommandRegistry.get_command()
instead ofCommandRegistry.commands.get()
app.py::get_command()
toextract_command
to clarify its functionPromptGenerator
test_generate_prompt_string
command_name in registry
instead ofcommand_name in registry.commands
test_command_in_registry
to testin
operatorDocumentation
x
Test Plan
CI; see changes to tests
PR Quality Checklist