diff --git a/astrbot/core/provider/sources/gemini_source.py b/astrbot/core/provider/sources/gemini_source.py index 7626df23..2ff017c3 100644 --- a/astrbot/core/provider/sources/gemini_source.py +++ b/astrbot/core/provider/sources/gemini_source.py @@ -291,19 +291,19 @@ class ProviderGoogleGenAI(Provider): result_parts: Optional[types.Part] = result.candidates[0].content.parts if finish_reason == types.FinishReason.SAFETY: - raise Exception("模型生成内容未通过用户定义的内容安全检查") + raise Exception("模型生成内容未通过 Gemini 平台的安全检查") if finish_reason in { types.FinishReason.PROHIBITED_CONTENT, types.FinishReason.SPII, types.FinishReason.BLOCKLIST, }: - raise Exception("模型生成内容违反Gemini平台政策") + raise Exception("模型生成内容违反 Gemini 平台政策") # 防止旧版本SDK不存在IMAGE_SAFETY if hasattr(types.FinishReason, "IMAGE_SAFETY"): if finish_reason == types.FinishReason.IMAGE_SAFETY: - raise Exception("模型生成内容违反Gemini平台政策") + raise Exception("模型生成内容违反 Gemini 平台政策") if not result_parts: logger.debug(result.candidates)