Open sternj opened 2 months ago
I think it could also be incorporated as a context block
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
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.