feat: supports reasoning_content (#1159)

This commit is contained in:
yetone
2025-02-02 02:12:14 +08:00
committed by GitHub
parent d1286e7bfb
commit b5ac768416
5 changed files with 23 additions and 9 deletions

View File

@@ -139,6 +139,8 @@ M._stream = function(opts)
---@type AvanteCurlOutput
local spec = Provider.parse_curl_args(Provider, code_opts)
local resp_ctx = {}
---@param line string
local function parse_stream_data(line)
local event = line:match("^event: (.+)$")
@@ -147,7 +149,7 @@ M._stream = function(opts)
return
end
local data_match = line:match("^data: (.+)$")
if data_match then Provider.parse_response(data_match, current_event_state, handler_opts) end
if data_match then Provider.parse_response(resp_ctx, data_match, current_event_state, handler_opts) end
end
local function parse_response_without_stream(data)