ruby-openai icon indicating copy to clipboard operation
ruby-openai copied to clipboard

Clean Structured Output Support

Open frmsaul opened this issue 1 year ago • 3 comments

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)

frmsaul avatar Oct 24 '24 00:10 frmsaul

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

jeremedia avatar Oct 25 '24 21:10 jeremedia

+1

Jellyfishboy avatar Nov 13 '24 11:11 Jellyfishboy

Is there any reason why @jeremedia's proposal in https://github.com/alexrudall/ruby-openai/issues/508#issuecomment-2291916913 hasn't been adopted yet?

It looks like a good approach to structured outputs. This is a very important feature for adoption of this library, given structured output parsing is the cornerstone for many agentic workflows.

What's the best way of making the feature happen?

miguelff avatar Nov 20 '24 12:11 miguelff