From 6e8d9f84b8acc940aafa0b557a5cc64d9324ee11 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 10 Jun 2025 19:38:00 -0500 Subject: [PATCH] plugins/avante: providers migration --- plugins/by-name/avante/default.nix | 14 ++- .../plugins/by-name/avante/default.nix | 117 ++++++++++-------- 2 files changed, 76 insertions(+), 55 deletions(-) diff --git a/plugins/by-name/avante/default.nix b/plugins/by-name/avante/default.nix index 61d478cc..67c351a9 100644 --- a/plugins/by-name/avante/default.nix +++ b/plugins/by-name/avante/default.nix @@ -45,11 +45,15 @@ lib.nixvim.plugins.mkNeovimPlugin { settingsExample = { provider = "claude"; - claude = { - endpoint = "https://api.anthropic.com"; - model = "claude-3-5-sonnet-20240620"; - temperature = 0; - max_tokens = 4096; + providers = { + claude = { + endpoint = "https://api.anthropic.com"; + model = "claude-3-5-sonnet-20240620"; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; }; mappings = { diff = { diff --git a/tests/test-sources/plugins/by-name/avante/default.nix b/tests/test-sources/plugins/by-name/avante/default.nix index 7a332ad7..d87e60d8 100644 --- a/tests/test-sources/plugins/by-name/avante/default.nix +++ b/tests/test-sources/plugins/by-name/avante/default.nix @@ -15,52 +15,65 @@ system_prompt = '' You are an excellent programming expert. ''; - openai = { - endpoint = "https://api.openai.com/v1"; - model = "gpt-4o"; - timeout = 30000; - temperature = 0; - max_tokens = 4096; + providers = { + openai = { + endpoint = "https://api.openai.com/v1"; + model = "gpt-4o"; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; + copilot = { + endpoint = "https://api.githubcopilot.com"; + model = "gpt-4o-2024-05-13"; + proxy = null; + allow_insecure = false; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; + azure = { + endpoint = ""; + deployment = ""; + api_version = "2024-06-01"; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; + claude = { + endpoint = "https://api.anthropic.com"; + model = "claude-3-5-sonnet-20240620"; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 8000; + }; + }; + gemini = { + endpoint = "https://generativelanguage.googleapis.com/v1beta/models"; + model = "gemini-1.5-flash-latest"; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; + cohere = { + endpoint = "https://api.cohere.com/v1"; + model = "command-r-plus-08-2024"; + timeout = 30000; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; }; - copilot = { - endpoint = "https://api.githubcopilot.com"; - model = "gpt-4o-2024-05-13"; - proxy = null; - allow_insecure = false; - timeout = 30000; - temperature = 0; - max_tokens = 4096; - }; - azure = { - endpoint = ""; - deployment = ""; - api_version = "2024-06-01"; - timeout = 30000; - temperature = 0; - max_tokens = 4096; - }; - claude = { - endpoint = "https://api.anthropic.com"; - model = "claude-3-5-sonnet-20240620"; - timeout = 30000; - temperature = 0; - max_tokens = 8000; - }; - gemini = { - endpoint = "https://generativelanguage.googleapis.com/v1beta/models"; - model = "gemini-1.5-flash-latest"; - timeout = 30000; - temperature = 0; - max_tokens = 4096; - }; - cohere = { - endpoint = "https://api.cohere.com/v1"; - model = "command-r-plus-08-2024"; - timeout = 30000; - temperature = 0; - max_tokens = 4096; - }; - vendors = { }; behaviour = { auto_suggestions = false; auto_set_highlight_group = true; @@ -151,11 +164,15 @@ settings = { provider = "claude"; - claude = { - endpoint = "https://api.anthropic.com"; - model = "claude-3-5-sonnet-20240620"; - temperature = 0; - max_tokens = 4096; + providers = { + claude = { + endpoint = "https://api.anthropic.com"; + model = "claude-3-5-sonnet-20240620"; + extra_request_body = { + temperature = 0; + max_tokens = 4096; + }; + }; }; mappings = { diff = {