fix(gemini): add role field to systemInstruction

This commit is contained in:
Henrik Bentel
2026-06-13 06:12:52 -07:00
committed by Teknium
parent 74c5158b10
commit eed61a1251
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -330,7 +330,7 @@ def _build_gemini_contents(messages: List[Dict[str, Any]]) -> tuple[List[Dict[st
system_instruction = None
joined_system = "\n".join(part for part in system_text_parts if part).strip()
if joined_system:
system_instruction = {"parts": [{"text": joined_system}]}
system_instruction = {"role": "system", "parts": [{"text": joined_system}]}
return contents, system_instruction