fix: 修复 Gemini 多段文本响应内容拼接问题

This commit is contained in:
yinpeng
2025-02-12 17:47:03 +08:00
parent b3851441f1
commit 5a4619444b

View File

@@ -232,7 +232,9 @@ def _extract_text(response: Dict[str, Any], model: str, stream: bool = False) ->
else:
text = candidate["content"]["parts"][0]["text"]
else:
text = candidate["content"]["parts"][0]["text"]
text = ""
for part in candidate["content"]["parts"]:
text += part["text"]
text = _add_search_link_text(model, candidate, text)
else:
text = "暂无返回"