-
Notifications
You must be signed in to change notification settings - Fork 9
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
Integrate Structured Outputs with Scala Classes/Functions #206
Comments
This does sound interesting, though I'd need to understand a bit more in detail as to what's the scope of the feature that you are proposing. So first there's a component that generates a JSON Schema from a case class? This does sound familiar to a part of what Tapir does. Although originally developed for an HTTP library, maybe could be useful here as well? Secondly, there would be some code needed to integrate with structured outputs and the protocol that OpenAI expects. I think this would definitely be in the scope of a project such as sttp-openai. |
The scope of this would be two features that I think would allow for innovative and seamless ways to combine LLMs with traditional programming/computation. Much of this is only possible thanks to the static type system and the advanced meta-programming features of Scala. Automatic Function Registration and Invocation Have an LLM Simulate a Function Invocation |
Thanks for the in-depth explanation. Both features look exciting :) Would be great if this could be part of sttp-openai. As I wrote before, maybe the process of generating the JSON Schema can be simplified by just using tapir-core to derive the schemas. |
Last year, I worked on a project called Syncodia, where I explored using Scala classes/functions to specify JSON schemas and allow invoking functions seamlessly. Although it was an early proof of concept, I believe that adapting schema-inference macros from JSON serialization libraries could allow for a cleaner implementation.
With the recent support for Structured Outputs, integrating with Scala classes has become even more useful. This feature could provide type safety and simplify schema definitions when interacting with the OpenAI API.
Would this be within the scope of the project? If so, I’d be interested in contributing designs and code. I’d appreciate your thoughts on this proposal.
The text was updated successfully, but these errors were encountered: