fix: gemini ReAct (#2132)

This commit is contained in:
yetone
2025-06-04 01:14:06 +08:00
committed by GitHub
parent fe8e34ce86
commit fc0e78e88f
7 changed files with 46 additions and 24 deletions

View File

@@ -1424,6 +1424,16 @@ function M.get_tool_use_message(message, messages)
return nil
end
---@param tool_use AvanteLLMToolUse
function M.tool_use_to_xml(tool_use)
local xml = string.format("<%s>\n", tool_use.name)
for k, v in pairs(tool_use.input or {}) do
xml = xml .. string.format("<%s>%s</%s>\n", k, tostring(v), k)
end
xml = xml .. "</" .. tool_use.name .. ">"
return xml
end
---@param tool_use AvanteLLMToolUse
function M.is_replace_func_call_tool_use(tool_use)
local is_replace_func_call = false