refactor(sidebar&claude): Simplify Claude provider and unify sidebar UI behavior (#2017)

This commit is contained in:
aniaan
2025-05-08 21:48:17 +08:00
committed by GitHub
parent f65e72900f
commit 1e80305af2
2 changed files with 1 additions and 14 deletions

View File

@@ -317,19 +317,8 @@ function M:parse_response(ctx, data_stream, event_state, opts)
if jsn.delta.stop_reason == "end_turn" then
opts.on_stop({ reason = "complete", usage = jsn.usage })
elseif jsn.delta.stop_reason == "tool_use" then
local tool_use_list = {}
for _, content_block in ipairs(ctx.content_blocks) do
if content_block.type == "tool_use" then
table.insert(tool_use_list, {
id = content_block.id,
name = content_block.name,
input_json = content_block.input_json,
})
end
end
opts.on_stop({
reason = "tool_use",
-- tool_use_list = tool_use_list,
usage = jsn.usage,
})
end