fix(llm): persistent key check for override class (#158)
* fix(llm): make sure to allow passing custom module Signed-off-by: Aaron Pham <contact@aarnphm.xyz> * fix: correct custom class Signed-off-by: Aaron Pham <contact@aarnphm.xyz> * fix: correct attribute Signed-off-by: Aaron Pham <contact@aarnphm.xyz> --------- Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
@@ -6,10 +6,10 @@ local P = require("avante.providers")
|
||||
---@class AvanteProviderFunctor
|
||||
local M = {}
|
||||
|
||||
M.API_KEY = "ANTHROPIC_API_KEY"
|
||||
M.api_key_name = "ANTHROPIC_API_KEY"
|
||||
|
||||
M.has = function()
|
||||
return os.getenv(M.API_KEY) and true or false
|
||||
return os.getenv(M.api_key_name) and true or false
|
||||
end
|
||||
|
||||
M.parse_message = function(opts)
|
||||
@@ -93,7 +93,7 @@ M.parse_curl_args = function(provider, code_opts)
|
||||
["anthropic-beta"] = "prompt-caching-2024-07-31",
|
||||
}
|
||||
if not P.env.is_local("claude") then
|
||||
headers["x-api-key"] = os.getenv(M.API_KEY)
|
||||
headers["x-api-key"] = os.getenv(base.api_key_name or M.api_key_name)
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user