mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-08 17:36:37 +08:00
fix: 修复 Gemini 多段文本响应内容拼接问题
This commit is contained in:
@@ -232,7 +232,9 @@ def _extract_text(response: Dict[str, Any], model: str, stream: bool = False) ->
|
|||||||
else:
|
else:
|
||||||
text = candidate["content"]["parts"][0]["text"]
|
text = candidate["content"]["parts"][0]["text"]
|
||||||
else:
|
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)
|
text = _add_search_link_text(model, candidate, text)
|
||||||
else:
|
else:
|
||||||
text = "暂无返回"
|
text = "暂无返回"
|
||||||
|
|||||||
Reference in New Issue
Block a user