feat: tools (#1180)

* feat: tools

* feat: claude use tools

* feat: openai use tools
This commit is contained in:
yetone
2025-02-05 22:39:54 +08:00
committed by GitHub
parent 1726d32778
commit 1437f319d2
17 changed files with 1321 additions and 74 deletions

View File

@@ -62,7 +62,7 @@ M.parse_stream_data = function(data, opts)
local json = vim.json.decode(data)
if json.type ~= nil then
if json.type == "message-end" and json.delta.finish_reason == "COMPLETE" then
opts.on_complete(nil)
opts.on_stop({ reason = "complete" })
return
end
if json.type == "content-delta" then opts.on_chunk(json.delta.message.content.text) end