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.
This commit is contained in:
msvechla 2024-12-04 11:57:07 +01:00 committed by GitHub
parent 57311bf8cd
commit 6206998f24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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, any> | string, headers: table<string, string>}
---@class AvanteCurlOutput: {url: string, proxy: string, insecure: boolean, body: table<string, any> | string, headers: table<string, string>, rawArgs: string[] | nil}
---@alias AvanteCurlArgsParser fun(opts: AvanteProvider | AvanteProviderFunctor, code_opts: AvantePromptOptions): AvanteCurlOutput
---
---@class ResponseParser