From 09bfa85e69cda7ac3a4a1dbc8f48029987059790 Mon Sep 17 00:00:00 2001 From: jesonliao Date: Thu, 3 Jul 2025 23:08:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dapi=E4=B8=AD=E5=AF=B9r?= =?UTF-8?q?ole=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 官方给的demo是不传role的 --- app/domain/gemini_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/domain/gemini_models.py b/app/domain/gemini_models.py index 54392e2..0efcac9 100644 --- a/app/domain/gemini_models.py +++ b/app/domain/gemini_models.py @@ -44,12 +44,12 @@ class GenerationConfig(BaseModel): class SystemInstruction(BaseModel): - role: str = "system" + role: Optional[str] = "system" parts: Union[List[Dict[str, Any]], Dict[str, Any]] class GeminiContent(BaseModel): - role: str + role: Optional[str] = None parts: List[Dict[str, Any]]