perf: content元素拼接时使用换行符间隔

This commit is contained in:
RockChinQ
2024-06-24 17:04:50 +08:00
parent 5092a82739
commit 39ce5646f6

View File

@@ -110,7 +110,7 @@ class OpenAIChatCompletions(api.LLMAPIRequester):
# 检查 content 列表中是否每个部分都是文本
if all(isinstance(part, dict) and part.get("type") == "text" for part in content):
# 将所有文本部分合并为一个字符串
msg_dict["content"] = "".join(part["text"] for part in content)
msg_dict["content"] = "\n".join(part["text"] for part in content)
req_messages.append(msg_dict)
try: