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

@@ -226,6 +226,8 @@ function M:add_text_message(ctx, text, state, opts)
if llm_tool_names == nil then llm_tool_names = LlmTools.get_tool_names() end
if ctx.content == nil then ctx.content = "" end
ctx.content = ctx.content .. text
local content = ctx.content:gsub("<tool_code>", ""):gsub("</tool_code>", "")
ctx.content = content
local msg = HistoryMessage:new({
role = "assistant",
content = ctx.content,