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 key error #1507

Merged

Conversation

jacobtohahn
Copy link
Contributor

Background

If AutoGPT attempted to use message_agent with the key as a string [STRING], the command would return "Error: invalid literal for int() with base 10: '[STRING]'". This confused the AI and could lead to loops or JSON errors.

Changes

Before, the message_agent function in commands.py allowed the key to be a string, generating the error described above.
The message_agent function has been modified to only allow the key to be an integer, returning "Invalid key, must be an integer." if it is not.

Documentation

Test Plan

The changes were tested by using human feedback to instruct the agent to use a string as a key, and verifying the command returned "Invalid key, must be an integer." if it was. The agent was then allowed to use an integer as a key, which produced the expected result.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@jacobtohahn
Copy link
Contributor Author

@nponeccop replacement for #1341

@nponeccop
Copy link
Contributor

@jacobtohahn There are conflicts now

@jacobtohahn
Copy link
Contributor Author

@nponeccop thanks for the heads up, just resolved them

@richbeales richbeales merged commit f6a8da0 into Significant-Gravitas:master Apr 15, 2023
@jacobtohahn jacobtohahn deleted the fix_agent_key_error branch April 15, 2023 18:55
@nponeccop nponeccop mentioned this pull request Apr 15, 2023
1 task
sindlinger pushed a commit to Orgsindlinger/Auto-GPT-WebUI that referenced this pull request Sep 25, 2024
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.

3 participants