Skip to content

Commit a9e9a2b

Browse files
committed
fix(gemini): remove thought tags from inline output
1 parent 5284f03 commit a9e9a2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/codecompanion/adapters/http/gemini.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ return {
128128
end,
129129
},
130130
inline_output = function(self, data, context)
131-
return openai.handlers.inline_output(self, data, context)
131+
local inline_output = openai.handlers.inline_output(self, data, context)
132+
if inline_output then
133+
return { status = inline_output.status, output = inline_output.output:gsub("^<thought>.*</thought>", "") }
134+
end
135+
return nil
132136
end,
133137
on_exit = function(self, data)
134138
return openai.handlers.on_exit(self, data)

0 commit comments

Comments
 (0)