guidance-ai / guidance

A guidance language for controlling large language models.
MIT License
19.02k stars 1.04k forks source link

Use pydantic models as grammar constraints #462

Open Maro1F431 opened 11 months ago

Maro1F431 commented 11 months ago

Is your feature request related to a problem? Please describe. I need integration with existing pydantic models, as it gets annoying to re implement them as guidance grammar.

Describe the solution you'd like Being easily able to convert or use any pydantic model as a grammar constraint for generation.

Describe alternatives you've considered I have used Guidance Pydantic Program. But I think something officially maintained would be much better.

Harsha-Nori commented 11 months ago

Thanks for the suggestion @Maro1F431! Seems like the Guidance Pydantic Program also depends on an older version of guidance (https://github.com/guidance-ai/guidance/issues/495) so agreed that having something built on our updated library (v0.1+) would be useful. Have this on the backlog :)