Fix Gemini models to output valid json when configured

This commit is contained in:
Debanjum
2025-03-18 16:53:28 +05:30
parent ce60cb9779
commit 2ab8e711d3

View File

@@ -65,6 +65,7 @@ def gemini_completion_with_backoff(
temperature=temperature,
max_output_tokens=MAX_OUTPUT_TOKENS_GEMINI,
safety_settings=SAFETY_SETTINGS,
response_mime_type=model_kwargs.get("response_mime_type", "text/plain") if model_kwargs else "text/plain",
)
formatted_messages = [gtypes.Content(role=message.role, parts=message.content) for message in messages]