guidance icon indicating copy to clipboard operation
guidance copied to clipboard

Support for OpenAI structured output

Open sternj opened this issue 1 year ago • 2 comments

OpenAI now allows for structured output, as mentioned in #720 . With the support for Pydantic schemas in #699 and #724 , it's feasible that a passthrough could be added, I'd be inclined to put it where the schema is being generated (I'm unsure if openai will work with JSON rather than a Pydantic schema) or in _gen_json.

sternj avatar Sep 05 '24 21:09 sternj

I think it could also be incorporated as a context block

sternj avatar Sep 05 '24 21:09 sternj

Hey @sternj, I think this is a great suggestion. On top of OpenAI, it looks like Google and Cohere also have JSON schema support. We're planning on revisiting all of our remote model classes in the near future, and I think extending their APIs to support this would be a great feature. Hope we can continue a brainstorm and discussion here as we work towards this in our backlog!

@nking-1 as FYI who has been thinking about similar ideas

Harsha-Nori avatar Sep 06 '24 06:09 Harsha-Nori