solnic / drops

🛠️ Tools for working with data effectively - data contracts using types, schemas, domain validation rules, type-safe casting, and more.
Other
248 stars 4 forks source link

JSON schema #47

Open torepettersen opened 5 months ago

torepettersen commented 5 months ago

Hi and tanks for creating this lovley validation library.

It seems like it would fit quite nice for validating JSON responses returned from OpenAI and other LLM's.

LLM's usually require a JSON Schema as input. For this reason it would be quite convenient if it would be possible to auto generate a JSON schema from the Drops schema. Would auto generating of the JSON Schema be something that makes sense to add to the Drops library?

solnic commented 5 months ago

@torepettersen hey thanks! Yes JSON schema generator is on the roadmap 🙂

torepettersen commented 5 months ago

Very nice :blush:

Would you be interesetd in contributions? And in that case have you made yourself some thoughts around how to add descriptions? I guess it would be possible to start without, but seems like the schema needs to be extended somehow to add that.

solnic commented 4 months ago

Thank you, yes but after I'm done with the core functionality, which I plan to finalize in ver 1.0

torepettersen commented 2 months ago

I made a fork where I started to add the functionality. Feel free to ping me when the core functionality is stable enough for me to open PR's. You could also feel free to just steal it, if you prefer that.

solnic commented 2 months ago

@torepettersen ohh that's great, thanks! will do 😄