Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OpenAI structured output #1010

Open
sternj opened this issue Sep 5, 2024 · 2 comments
Open

Support for OpenAI structured output #1010

sternj opened this issue Sep 5, 2024 · 2 comments

Comments

@sternj
Copy link

sternj commented Sep 5, 2024

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
Copy link
Author

sternj commented Sep 5, 2024

I think it could also be incorporated as a context block

@Harsha-Nori
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants