mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: validate tool_call_id pairing #2690
This commit is contained in:
@@ -13,6 +13,7 @@ from bridge.reply import Reply, ReplyType
|
||||
from common.log import logger
|
||||
from config import conf, load_config
|
||||
from common import const
|
||||
from agent.protocol.message_utils import drop_orphaned_tool_results_openai
|
||||
|
||||
|
||||
# MiniMax对话模型API
|
||||
@@ -356,7 +357,7 @@ class MinimaxBot(Bot):
|
||||
|
||||
converted.append(openai_msg)
|
||||
|
||||
return converted
|
||||
return drop_orphaned_tool_results_openai(converted)
|
||||
|
||||
def _convert_tools_to_openai_format(self, tools):
|
||||
"""
|
||||
|
||||
@@ -10,6 +10,7 @@ This includes: OpenAI, LinkAI, Azure OpenAI, and many third-party providers.
|
||||
import json
|
||||
import openai
|
||||
from common.log import logger
|
||||
from agent.protocol.message_utils import drop_orphaned_tool_results_openai
|
||||
|
||||
|
||||
class OpenAICompatibleBot:
|
||||
@@ -300,5 +301,5 @@ class OpenAICompatibleBot:
|
||||
else:
|
||||
# Other formats, keep as is
|
||||
openai_messages.append(msg)
|
||||
|
||||
return openai_messages
|
||||
|
||||
return drop_orphaned_tool_results_openai(openai_messages)
|
||||
|
||||
Reference in New Issue
Block a user