-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Custom provider not recognized #1010
Labels
bug
Something isn't working
Comments
I'm not sure if this is the root cause but nesting in your configuration is incorrect. Can you try this and see if it helps?
return {
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false, -- set this if you want to always pull the latest change
opts = {
-- add any opts here
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
provider = "ppq",
vendors = {
---@type AvanteProvider
["ppq"] = {
endpoint = "https://api.ppq.ai",
model = "claude-3.5-sonnet",
api_key_name = "PPQ_API_KEY",
parse_curl_args = function(opts, code_opts)
return {
url = opts.endpoint .. "/chat/completions",
headers = {
["Content-Type"] = "application/json",
["Authorization"] = "Bearer " .. os.getenv(opts.api_key_name),
},
body = {
model = opts.model,
messages = require("avante.providers").copilot.parse_messages(code_opts), -- you can make your own message, but this is very advanced
max_tokens = 2048,
stream = true,
},
}
end,
parse_response_data = function(data_stream, event_state, opts)
require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end,
},
},
},
dependencies = {
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"zbirenbaum/copilot.lua", -- for providers='copilot'
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hello,
I'm trying to use ppq.ai as a custom provider. I read through the Custom Provider wiki and created the config
lua/plugins/avante.lua
below (using lazy.nvim). The trouble is avante doesn't seem to recognize that I added a custom provider. When I do<leader>aa
after startingnvim
it just prompts me forANTHROPIC_API_KEY
and gives me the following error message:What am I missing here? Any help would be appreciated.
To reproduce
Expected behavior
No response
Installation method
Use lazy.nvim:
Environment
nvim -v
:uname -a
:Repro
No response
The text was updated successfully, but these errors were encountered: