Skip to content

Commit 6e8d9f8

Browse files
khanelimanGaetanLepage
authored andcommitted
plugins/avante: providers migration
1 parent e89eb15 commit 6e8d9f8

File tree

2 files changed

+76
-55
lines changed

2 files changed

+76
-55
lines changed

plugins/by-name/avante/default.nix

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
4545

4646
settingsExample = {
4747
provider = "claude";
48-
claude = {
49-
endpoint = "https://api.anthropic.com";
50-
model = "claude-3-5-sonnet-20240620";
51-
temperature = 0;
52-
max_tokens = 4096;
48+
providers = {
49+
claude = {
50+
endpoint = "https://api.anthropic.com";
51+
model = "claude-3-5-sonnet-20240620";
52+
extra_request_body = {
53+
temperature = 0;
54+
max_tokens = 4096;
55+
};
56+
};
5357
};
5458
mappings = {
5559
diff = {

tests/test-sources/plugins/by-name/avante/default.nix

Lines changed: 67 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,52 +15,65 @@
1515
system_prompt = ''
1616
You are an excellent programming expert.
1717
'';
18-
openai = {
19-
endpoint = "https://api.openai.com/v1";
20-
model = "gpt-4o";
21-
timeout = 30000;
22-
temperature = 0;
23-
max_tokens = 4096;
24-
};
25-
copilot = {
26-
endpoint = "https://api.githubcopilot.com";
27-
model = "gpt-4o-2024-05-13";
28-
proxy = null;
29-
allow_insecure = false;
30-
timeout = 30000;
31-
temperature = 0;
32-
max_tokens = 4096;
33-
};
34-
azure = {
35-
endpoint = "";
36-
deployment = "";
37-
api_version = "2024-06-01";
38-
timeout = 30000;
39-
temperature = 0;
40-
max_tokens = 4096;
41-
};
42-
claude = {
43-
endpoint = "https://api.anthropic.com";
44-
model = "claude-3-5-sonnet-20240620";
45-
timeout = 30000;
46-
temperature = 0;
47-
max_tokens = 8000;
48-
};
49-
gemini = {
50-
endpoint = "https://generativelanguage.googleapis.com/v1beta/models";
51-
model = "gemini-1.5-flash-latest";
52-
timeout = 30000;
53-
temperature = 0;
54-
max_tokens = 4096;
55-
};
56-
cohere = {
57-
endpoint = "https://api.cohere.com/v1";
58-
model = "command-r-plus-08-2024";
59-
timeout = 30000;
60-
temperature = 0;
61-
max_tokens = 4096;
18+
providers = {
19+
openai = {
20+
endpoint = "https://api.openai.com/v1";
21+
model = "gpt-4o";
22+
timeout = 30000;
23+
extra_request_body = {
24+
temperature = 0;
25+
max_tokens = 4096;
26+
};
27+
};
28+
copilot = {
29+
endpoint = "https://api.githubcopilot.com";
30+
model = "gpt-4o-2024-05-13";
31+
proxy = null;
32+
allow_insecure = false;
33+
timeout = 30000;
34+
extra_request_body = {
35+
temperature = 0;
36+
max_tokens = 4096;
37+
};
38+
};
39+
azure = {
40+
endpoint = "";
41+
deployment = "";
42+
api_version = "2024-06-01";
43+
timeout = 30000;
44+
extra_request_body = {
45+
temperature = 0;
46+
max_tokens = 4096;
47+
};
48+
};
49+
claude = {
50+
endpoint = "https://api.anthropic.com";
51+
model = "claude-3-5-sonnet-20240620";
52+
timeout = 30000;
53+
extra_request_body = {
54+
temperature = 0;
55+
max_tokens = 8000;
56+
};
57+
};
58+
gemini = {
59+
endpoint = "https://generativelanguage.googleapis.com/v1beta/models";
60+
model = "gemini-1.5-flash-latest";
61+
timeout = 30000;
62+
extra_request_body = {
63+
temperature = 0;
64+
max_tokens = 4096;
65+
};
66+
};
67+
cohere = {
68+
endpoint = "https://api.cohere.com/v1";
69+
model = "command-r-plus-08-2024";
70+
timeout = 30000;
71+
extra_request_body = {
72+
temperature = 0;
73+
max_tokens = 4096;
74+
};
75+
};
6276
};
63-
vendors = { };
6477
behaviour = {
6578
auto_suggestions = false;
6679
auto_set_highlight_group = true;
@@ -151,11 +164,15 @@
151164

152165
settings = {
153166
provider = "claude";
154-
claude = {
155-
endpoint = "https://api.anthropic.com";
156-
model = "claude-3-5-sonnet-20240620";
157-
temperature = 0;
158-
max_tokens = 4096;
167+
providers = {
168+
claude = {
169+
endpoint = "https://api.anthropic.com";
170+
model = "claude-3-5-sonnet-20240620";
171+
extra_request_body = {
172+
temperature = 0;
173+
max_tokens = 4096;
174+
};
175+
};
159176
};
160177
mappings = {
161178
diff = {

0 commit comments

Comments
 (0)