AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Depth first json fixer

Open AutomaticHourglass opened this issue 2 years ago • 5 comments

Background

JSON parsing is difficult and not that robust. I have implemented a package that does Depth First Search to replace or add multiple characters to make a JSON parseable. link to the repo: https://github.com/AutomaticHourglass/dfsjson

Changes

Just a small addition to the JSON parser that tries multiple algorithms, now it tries one more.

Documentation

Test Plan

I have implemented unit tests in the package repo in which the performance looks good.

PR Quality Checklist

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

AutomaticHourglass avatar Apr 22 '23 11:04 AutomaticHourglass

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 24 '23 18:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 24 '23 18:04 github-actions[bot]

This is a mass message from the AutoGPT core team. Our apologies for the ongoing delay in processing PRs. This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

p-i- avatar May 05 '23 00:05 p-i-

My only comment/complaint is how well do you plan on supporting your JSON parser? The issue with relying on source code with one maintainer, is that there is only 1 maintainer.

anonhostpi avatar May 05 '23 19:05 anonhostpi

I've developed a novel JSON parsing algorithm that takes a different approach, catering to specific use cases that might not be covered by other algorithms. I intend to refine the algorithm as necessary, but given its signature's use of primitive types, maintenance should be minimal.

I welcome any questions or input you might have.

Best regards, Unsal

"Exponential tree is a lie"

Dr. Ünsal Gökdağ Staff Data Scientist forto Co. KG Berlin

On Fri, May 5, 2023 at 9:43 PM Blue Falcon @.***> wrote:

My only comment/complaint is how well do you plan on supporting your JSON parser? The issue with relying on source code with one maintainer, is that there is only 1 maintainer.

— Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/pull/2912#issuecomment-1536698406, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZK5D5U7AWLKWLXLDEXHULXEVJ5BANCNFSM6AAAAAAXHZC7CA . You are receiving this because you authored the thread.Message ID: @.***>

AutomaticHourglass avatar May 07 '23 20:05 AutomaticHourglass

@erik-megarad WDYT?

Pwuts avatar Jun 14 '23 23:06 Pwuts

fix_and_parse_json no longer exists, and since we started using a JSON schema to describe the desired response format, we have been getting far less JSON errors. Thanks for submitting though, this looks like an interesting fix as well.

Feel free to contribute again: join the Discord server to discuss and coordinate further. :)

Pwuts avatar Jul 07 '23 06:07 Pwuts