-
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 the accuracy of the extract_dict_from_response method's JSON extraction. #5458
Merged
Pwuts
merged 7 commits into
Significant-Gravitas:master
from
HawkClaws:feature/`extract_dict_from_response`-method's-update
Nov 16, 2023
Merged
Improve the accuracy of the extract_dict_from_response method's JSON extraction. #5458
Pwuts
merged 7 commits into
Significant-Gravitas:master
from
HawkClaws:feature/`extract_dict_from_response`-method's-update
Nov 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for auto-gpt-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…_from_response`-method's-update
…_from_response`-method's-update
…_from_response`-method's-update
ntindle
previously approved these changes
Nov 5, 2023
github-actions
bot
added
the
conflicts
Automatically applied to PRs with merge conflicts
label
Nov 16, 2023
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
github-actions
bot
removed
the
conflicts
Automatically applied to PRs with merge conflicts
label
Nov 16, 2023
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
LGTM! |
Pwuts
added
the
invalid_json
Groups issues and PRs related to invalid json error or similar
label
Nov 16, 2023
Pwuts
added a commit
that referenced
this pull request
Nov 30, 2023
- Fixed linting issues in `json_utils/utilities.py` and `test_json_utils.py`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
JSON parse error in extract_dict_from_response method
Changes 🏗️
extract_dict_from_response method in `autogpts\autogpt\autogpt\json_utils\utilities.p
PR Quality Scorecard ✨
+2 pts
+5 pts
+5 pts
+5 pts
-4 pts
+4 pts
+5 pts
-5 pts
agbenchmark
to verify that these changes do not regress performance?+10 pts
Improve the accuracy of the
extract_dict_from_response
method's JSON extraction.Improve the accuracy of the
extract_dict_from_response
method's JSON extraction.Currently, the following response causes JSON extraction/parse errors.
This branch will resolve these issues.
Test Data
We have confirmed that JSON can be retrieved from the following text
The previous
extract_dict_from_response
gave an error.Example 1:
raw JSON
{
"thoughts": {
"text": "I need to ask the user if they can provide information on a basic cola recipe.",
"reasoning": "Since the attempt to gather information via web search was unsuccessful, I will seek the user's cooperation.",
"plan": "I will ask the user, and if I receive a positive response, I will provide a basic cola recipe.",
"criticism": "Since the information gathering attempt was unsuccessful, we should consider ways to improve efficiency.",
"speak": "Can you provide information on a basic cola recipe?"
},
"command": {
"name": "ask_user",
"args": {
"question": "Can you provide information on a basic cola recipe?"
}
}
}
Example 2:
If the code block
Example 3:
If the code block contains the name
json
, thenExample 4:
JSON contained in a string
Based on the goal, I will determine the following command and provide information about the progress.
Goal:
To provide the highest quality cola recipe, including detailed instructions on ingredients, seasonings, carbonation, and blending methods.
Command Decision:
Next, I conducted a web search to provide a basic cola recipe, but I couldn't find any information. Therefore, I need to ask the user if they can provide information on a basic cola recipe.
JSON:
I'm awaiting the user's response.