-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
feat(agent): Implement more tolerant json_loads
function
#7016
feat(agent): Implement more tolerant json_loads
function
#7016
Conversation
✅ Deploy Preview for auto-gpt-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Do you have benchmark stats for this? I’d like to see if it improves our score much |
autogpts/autogpt/autogpt/core/planning/prompt_strategies/initial_plan.py
Outdated
Show resolved
Hide resolved
And sort dependencies in `pyproject.toml` alphabetically.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
json_loads
functionjson_loads
function
…ctly-formatted-json-jsondecodeerror
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
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.
Very nice, LGTM!
json_loads
functionjson_loads
function
OPEN-183
Background
OpenAI API tends to return broken json responses (such as trailing commas, extra newlines) which fail to be parsed by built-in
json.loads
.This change introduces relaxed parsing function
json_loads
usingdemjson3
that handles minor syntax issues in json and is used wherejson.loads
was used previously to parse responses from llm.It can deal with:
Changes 🏗️
demjson3 ^3.0.0
(LGPLv3 license)json_loads
functionjson.loads
withjson_loads
across multiple files