You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with both OpenAI and Gemini models using JSON responses, I noticed that the way each API handles json_schema differs quite significantly. Currently, the json_schema details are provided externally (outside of the LangChain library), but to seamlessly support multiple AI providers without requiring the user to handle these differences manually, it would be valuable to introduce an abstraction layer for defining schemas.
I’d like to propose the addition of:
• An abstracted, unified representation of json_schema.
• AI-specific schema generators that can transform this abstract schema into the correct format for each provider (e.g., OpenAI, Gemini).
With such an abstraction in place, it would open the door to utilities that could easily convert existing structures like Typespecs, Ecto Schemas, or Ash Resources into this unified schema format. This would significantly reduce the friction when integrating structured data responses across different AI models.
Would love to hear thoughts on this idea! Happy to contribute if there’s interest.
The text was updated successfully, but these errors were encountered:
Currently, ash_ai(https://github.com/ash-project/ash_ai) uses the OpenAPI specification provided by ash_json_api. However, I feel that this approach may not be expressive enough for our needs. For example, Gemini introduces features like propertyOrdering which are outside the scope of the standard OpenAPI spec.
While working with both OpenAI and Gemini models using JSON responses, I noticed that the way each API handles json_schema differs quite significantly. Currently, the json_schema details are provided externally (outside of the LangChain library), but to seamlessly support multiple AI providers without requiring the user to handle these differences manually, it would be valuable to introduce an abstraction layer for defining schemas.
I’d like to propose the addition of:
• An abstracted, unified representation of json_schema.
• AI-specific schema generators that can transform this abstract schema into the correct format for each provider (e.g., OpenAI, Gemini).
With such an abstraction in place, it would open the door to utilities that could easily convert existing structures like Typespecs, Ecto Schemas, or Ash Resources into this unified schema format. This would significantly reduce the friction when integrating structured data responses across different AI models.
Would love to hear thoughts on this idea! Happy to contribute if there’s interest.
The text was updated successfully, but these errors were encountered: