From 6206998f240da6734bd49d830d76b2035d173f1d Mon Sep 17 00:00:00 2001 From: msvechla Date: Wed, 4 Dec 2024 11:57:07 +0100 Subject: [PATCH] chore: allow to pass raw curl args (#920) This can be used to pass additional arguments to curl, which can be helpful when working on new providers like bedrock, that can use curl arguments for authorization. --- lua/avante/llm.lua | 1 + lua/avante/providers/init.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/avante/llm.lua b/lua/avante/llm.lua index b13aa23..bbbfa02 100644 --- a/lua/avante/llm.lua +++ b/lua/avante/llm.lua @@ -155,6 +155,7 @@ M._stream = function(opts, Provider) proxy = spec.proxy, insecure = spec.insecure, body = curl_body_file, + raw = spec.rawArgs, stream = function(err, data, _) if err then completed = true diff --git a/lua/avante/providers/init.lua b/lua/avante/providers/init.lua index 4a00131..343437b 100644 --- a/lua/avante/providers/init.lua +++ b/lua/avante/providers/init.lua @@ -31,7 +31,7 @@ local DressingState = { winid = nil, input_winid = nil, input_bufnr = nil } --- ---@alias AvanteMessagesParser fun(opts: AvantePromptOptions): AvanteChatMessage[] --- ----@class AvanteCurlOutput: {url: string, proxy: string, insecure: boolean, body: table | string, headers: table} +---@class AvanteCurlOutput: {url: string, proxy: string, insecure: boolean, body: table | string, headers: table, rawArgs: string[] | nil} ---@alias AvanteCurlArgsParser fun(opts: AvanteProvider | AvanteProviderFunctor, code_opts: AvantePromptOptions): AvanteCurlOutput --- ---@class ResponseParser