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 various JSON input bugs #685

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

STRML
Copy link
Contributor

@STRML STRML commented Apr 10, 2023

Background

I was receiving an Invalid JSON error on pretty much every prompt. Once it was received, it was very difficult to get out of it.

Changes

By not having correct_json(json_str) in the try/except, it was still easily possible to throw Invalid JSON errors.

When responses were received with no JSON at all, parsing would fail on attempting to locate the braces.

Test Plan

Tested by running a bunch of prompts. Sorry it's not more scientific than that. Each time I got a parsing error, I added a fix, and now it seems stable.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thouroughly 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

@STRML STRML force-pushed the fix/json-parsing branch from 5b02af1 to e962028 Compare April 10, 2023 13:14
nponeccop
nponeccop previously approved these changes Apr 10, 2023
@nponeccop nponeccop mentioned this pull request Apr 10, 2023
1 task
@nponeccop
Copy link
Contributor

@Torantulino Can you merge it?

@nponeccop
Copy link
Contributor

@STRML Conflicts again.

@STRML
Copy link
Contributor Author

STRML commented Apr 12, 2023

@nponeccop Looks like the ValueError catch was added to master, so this is really only one change - ready for merge.

By not having correct_json(json_str) in the try/except,
it was still easily possible to throw Invalid JSON errors.

When responses were received with no JSON at all, parsing
would fail on attempting to locate the braces.
@richbeales richbeales merged commit c98471e into Significant-Gravitas:master Apr 12, 2023
SquareandCompass pushed a commit to SquareandCompass/Auto-GPT that referenced this pull request Oct 21, 2023
…#685)

* check config constraints for the initial config

* default config value
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