langchaingo icon indicating copy to clipboard operation
langchaingo copied to clipboard

Allow Gemini to be forced to respond with JSON.

Open dylanmazurek opened this issue 1 year ago • 2 comments

The Google Gemini API allows for a "responseMimeType" and "responseSchema" to be given as inputs forcing the response to be formatted in the specified format.

Is there any plans to enable this functionality?

Here are some details: https://ai.google.dev/api/rest/v1beta/GenerationConfig

dylanmazurek avatar Jun 18 '24 13:06 dylanmazurek

@dylanmazurek Yes this is absolutely a priority!

tmc avatar Jun 20 '24 12:06 tmc

@tmc, I didn't find an open PR for this, so I assume this isn't being worked on currently. I would start working on implementing support for responseMimeType tomorrow. responseSchema seems a bit trickier because there is no field in CallOptions for that at the moment.

mheck136 avatar Aug 08 '24 20:08 mheck136