From d456a4b8165bec1c2af257d6f93b94549f1af6f6 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 8 Nov 2024 20:39:41 -0800 Subject: [PATCH] Fix #78, add an error handler for unknown Gemini responses --- lib/instructor/adapters/gemini.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/instructor/adapters/gemini.ex b/lib/instructor/adapters/gemini.ex index 711419b..25cb88b 100644 --- a/lib/instructor/adapters/gemini.ex +++ b/lib/instructor/adapters/gemini.ex @@ -238,6 +238,10 @@ defmodule Instructor.Adapters.Gemini do Jason.decode(text) end + defp parse_response_for_mode(mode, response) do + {:error, "Unsupported Gemini mode #{mode} with response #{inspect(response)}"} + end + defp parse_stream_chunk_for_mode( :tools, %{