fix(style): add parentheses (#471)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local Utils = require "avante.utils"
|
||||
local Config = require "avante.config"
|
||||
local Clipboard = require "avante.clipboard"
|
||||
local P = require "avante.providers"
|
||||
local Utils = require("avante.utils")
|
||||
local Config = require("avante.config")
|
||||
local Clipboard = require("avante.clipboard")
|
||||
local P = require("avante.providers")
|
||||
|
||||
---@class OpenAIChatResponse
|
||||
---@field id string
|
||||
@@ -56,11 +56,11 @@ M.parse_message = function(opts)
|
||||
end
|
||||
|
||||
M.parse_response = function(data_stream, _, opts)
|
||||
if data_stream:match '"%[DONE%]":' then
|
||||
if data_stream:match('"%[DONE%]":') then
|
||||
opts.on_complete(nil)
|
||||
return
|
||||
end
|
||||
if data_stream:match '"delta":' then
|
||||
if data_stream:match('"delta":') then
|
||||
---@type OpenAIChatResponse
|
||||
local json = vim.json.decode(data_stream)
|
||||
if json.choices and json.choices[1] then
|
||||
@@ -80,7 +80,7 @@ M.parse_curl_args = function(provider, code_opts)
|
||||
local headers = {
|
||||
["Content-Type"] = "application/json",
|
||||
}
|
||||
if not P.env.is_local "openai" then headers["Authorization"] = "Bearer " .. provider.parse_api_key() end
|
||||
if not P.env.is_local("openai") then headers["Authorization"] = "Bearer " .. provider.parse_api_key() end
|
||||
|
||||
return {
|
||||
url = Utils.trim(base.endpoint, { suffix = "/" }) .. "/chat/completions",
|
||||
|
||||
Reference in New Issue
Block a user