修复错误代码

This commit is contained in:
taylorxie
2026-03-10 14:27:49 +08:00
parent 448a95134f
commit 249f225045

View File

@@ -1,5 +1,6 @@
import asyncio import asyncio
import json import json
import logging
from collections import deque from collections import deque
from typing import List from typing import List
@@ -410,7 +411,11 @@ class Gemini(Platform):
text = part.get("text", "") text = part.get("text", "")
if text: if text:
yield text yield text
if candidate.get("finishReason"): finish_reason = candidate.get("finishReason")
if finish_reason:
logging.getLogger("instance/aibot").debug(
f"Gemini stream finished: finishReason={finish_reason}"
)
break break
except json.JSONDecodeError: except json.JSONDecodeError:
pass pass