fix(providers): preserve assistant content with tool calls (#5783)
* fix(providers/openai-compatible): config option to preserve message content with tool calls * fix(providers): preserve assistant content with tool calls --------- Co-authored-by: chengyongru <2755839590@qq.com>
This commit is contained in:
1 parent
d386ba138e
commit
0374f74bb7
3 files changed
+53
-7
No files matched your search
@@ -785,10 +785,6 @@ class OpenAICompatProvider(LLMProvider):
|
||||
tc_clean["function"] = function_clean
|
||||
normalized.append(tc_clean)
|
||||
clean["tool_calls"] = normalized
|
||||
if clean.get("role") == "assistant":
|
||||
# Some OpenAI-compatible gateways reject assistant messages
|
||||
# that mix non-empty content with tool_calls.
|
||||
clean["content"] = None
|
||||
if "tool_call_id" in clean and clean["tool_call_id"]:
|
||||
clean["tool_call_id"] = map_tool_result_id(clean["tool_call_id"])
|
||||
if (
|
||||
|
||||
Reference in new issue
Block a user