-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
From here, we just need to continue generating tokens until we get to a closing quote. This approach was borrowed from Jsonformer which uses a similar approach to induce LLMs to generate structured output. Continuing to do so for each property using Replit's code LLM gives the following output:
While it's not perfect, and not obviously useful for such a small schema, I think the results are promising. I've also tried several other schema formats such as Zod, Typescript object types, and Pydantic. A lot more experimentation is required with these different formats and various LLMs to see which works best. So far, I'm pretty pleased with results. The code for this post is available on GitHub.
While it's not perfect, and not obviously useful for such a small schema, I think the results are promising. I've also tried several other schema formats such as Zod, Typescript object types, and Pydantic. A lot more experimentation is required with these different formats and various LLMs to see which works best. So far, I'm pretty pleased with results. The code for this post is available on GitHub.
Related posts
-
Simplifying Form Validation with Zod and React Hook Form
-
From Flaky to Flawless: Angular API Response Management with Zod
-
You can’t run away from runtime errors using TypeScript
-
Epic Next JS 14 Tutorial Part 4: How To Handle Login And Authentication in Next.js
-
Error handling in our form component for the NextAuth CredentialsProvider