Skip to content

NVR with realtime local object detection for IP cameras

Fix Gemini tool calling on 3.6+ by using documented function response role (#24013)

dtighe8384a8c5b321
diff --git a/frigate/genai/plugins/gemini.py b/frigate/genai/plugins/gemini.py
index 1c89806082..4af29ff8c9 100644
--- a/frigate/genai/plugins/gemini.py
+++ b/frigate/genai/plugins/gemini.py
@@ -245,7 +245,7 @@ class GeminiClient(GenAIClient):
)
gemini_messages.append(
types.Content(
- role="function",
+ role="user",
parts=[
types.Part.from_function_response(
name=msg.get("name")
@@ -501,7 +501,7 @@ class GeminiClient(GenAIClient):
)
gemini_messages.append(
types.Content(
- role="function",
+ role="user",
parts=[
types.Part.from_function_response(
name=msg.get("name")