alexrudall / ruby-openai

OpenAI API + Ruby! 🤖❤️
https://insertrobot.com
MIT License
2.79k stars 332 forks source link

Clean Structured Output Support #541

Open frmsaul opened 1 week ago

frmsaul commented 1 week ago

Is your feature request related to a problem? Please describe. Anyone had any luck supporting structure output?

https://platform.openai.com/docs/guides/structured-outputs/introduction

Describe the solution you'd like It would be awesome if we had a clean DSL to easily generate the json schema objects. I tried to use EasyTalk, but it results in incredibly ugly code.

Additional context What are some recommended solutions for this?

The Python and JS clients both have beautiful and easy ways of doing this (pydantic and zod)

jeremedia commented 1 week ago

https://github.com/alexrudall/ruby-openai/issues/508