修复错误代码
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
from collections import deque
|
||||
|
||||
from typing import List
|
||||
@@ -410,7 +411,11 @@ class Gemini(Platform):
|
||||
text = part.get("text", "")
|
||||
if 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
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user