tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
4.37k stars 595 forks source link

Allow Gemini to be forced to respond with JSON. #905

Closed dylanmazurek closed 2 weeks ago

dylanmazurek commented 3 months ago

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

tmc commented 3 months ago

@dylanmazurek Yes this is absolutely a priority!

mheck136 commented 1 month ago

@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.