You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
version = false, -- set this if you want to always pull the latest change
6
+
opts = {
7
+
-- add any opts here
8
+
},
9
+
config = function()
10
+
require('avante').setup({
11
+
-- provider = "ollama",
12
+
-- vendors = {
13
+
-- ollama = {
14
+
-- __inherited_from = "openai",
15
+
-- api_key_name = "",
16
+
-- endpoint = "http://127.0.0.1:11434/v1",
17
+
-- model = "mistral",
18
+
-- },
19
+
-- },
20
+
provider = "claude", -- Recommend using Claude
21
+
auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot
22
+
claude = {
23
+
endpoint = "https://api.anthropic.com",
24
+
model = "claude-3-5-sonnet-20241022",
25
+
temperature = 0,
26
+
max_tokens = 4096,
27
+
},
28
+
-- claude = {
29
+
-- endpoint = "https://api.anthropic.com",
30
+
-- model = "claude-3-5-sonnet-20241022",
31
+
-- temperature = 0,
32
+
-- max_tokens = 4096,
33
+
-- },
34
+
---Specify the special dual_boost mode
35
+
---1. enabled: Whether to enable dual_boost mode. Default to false.
36
+
---2. first_provider: The first provider to generate response. Default to "openai".
37
+
---3. second_provider: The second provider to generate response. Default to "claude".
38
+
---4. prompt: The prompt to generate response based on the two reference outputs.
39
+
---5. timeout: Timeout in milliseconds. Default to 60000.
40
+
---How it works:
41
+
--- When dual_boost is enabled, avante will generate two responses from the first_provider and second_provider respectively. Then use the response from the first_provider as provider1_output and the response from the second_provider as provider2_output. Finally, avante will generate a response based on the prompt and the two reference outputs, with the default Provider as normal.
42
+
---Note: This is an experimental feature and may not work as expected.
43
+
dual_boost = {
44
+
enabled = false,
45
+
first_provider = "openai",
46
+
second_provider = "claude",
47
+
prompt =
48
+
"Based on the two reference outputs below, generate a response that incorporates elements from both but reflects your own judgment and unique perspective. Do not provide any explanation, just give the response directly. Reference Output 1: [{{provider1_output}}], Reference Output 2: [{{provider2_output}}]",
49
+
timeout = 60000, -- Timeout in milliseconds
50
+
},
51
+
behaviour = {
52
+
auto_suggestions = true, -- Experimental stage
53
+
auto_set_highlight_group = true,
54
+
auto_set_keymaps = true,
55
+
auto_apply_diff_after_generation = false,
56
+
support_paste_from_clipboard = false,
57
+
minimize_diff = true, -- Whether to remove unchanged lines when applying a code block
58
+
},
59
+
mappings = {
60
+
diff = {
61
+
ours = "co",
62
+
theirs = "ct",
63
+
all_theirs = "ca",
64
+
both = "cb",
65
+
cursor = "cc",
66
+
next = "]x",
67
+
prev = "[x",
68
+
},
69
+
suggestion = {
70
+
accept = "<M-l>",
71
+
next = "<M-]>",
72
+
prev = "<M-[>",
73
+
dismiss = "<C-]>",
74
+
},
75
+
jump = {
76
+
next = "]]",
77
+
prev = "[[",
78
+
},
79
+
submit = {
80
+
normal = "<CR>",
81
+
insert = "<C-s>",
82
+
},
83
+
sidebar = {
84
+
apply_all = "A",
85
+
apply_cursor = "a",
86
+
switch_windows = "<Tab>",
87
+
reverse_switch_windows = "<S-Tab>",
88
+
},
89
+
},
90
+
hints = { enabled = true },
91
+
windows = {
92
+
---@type "right" | "left" | "top" | "bottom"
93
+
position = "right", -- the position of the sidebar
94
+
wrap = true, -- similar to vim.o.wrap
95
+
width = 30, -- default % based on available width
96
+
sidebar_header = {
97
+
enabled = true, -- true, false to enable/disable the header
98
+
align = "center", -- left, center, right for title
99
+
rounded = true,
100
+
},
101
+
input = {
102
+
prefix = "> ",
103
+
height = 8, -- Height of the input window in vertical layout
104
+
},
105
+
edit = {
106
+
border = "rounded",
107
+
start_insert = true, -- Start insert mode when opening the edit window
108
+
},
109
+
ask = {
110
+
floating = false, -- Open the 'AvanteAsk' prompt in a floating window
111
+
start_insert = true, -- Start insert mode when opening the ask window
112
+
border = "rounded",
113
+
focus_on_apply = "ours", -- which diff to focus after applying
114
+
},
115
+
},
116
+
highlights = {
117
+
diff = {
118
+
current = "DiffText",
119
+
incoming = "DiffAdd",
120
+
},
121
+
},
122
+
diff = {
123
+
autojump = true,
124
+
list_opener = "copen",
125
+
--- Override the 'timeoutlen' setting while hovering over a diff (see :help timeoutlen).
126
+
--- Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
127
+
--- Disable by setting to -1.
128
+
override_timeoutlen = 500,
129
+
},
130
+
})
131
+
end,
132
+
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
133
+
build = "make",
134
+
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
135
+
dependencies = {
136
+
"stevearc/dressing.nvim",
137
+
"nvim-lua/plenary.nvim",
138
+
"MunifTanjim/nui.nvim",
139
+
--- The below dependencies are optional,
140
+
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
141
+
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
142
+
"zbirenbaum/copilot.lua", -- for providers='copilot'
143
+
{
144
+
-- support for image pasting
145
+
"HakonHarnes/img-clip.nvim",
146
+
event = "VeryLazy",
147
+
opts = {
148
+
-- recommended settings
149
+
default = {
150
+
embed_image_as_base64 = false,
151
+
prompt_for_file_name = false,
152
+
drag_and_drop = {
153
+
insert_mode = true,
154
+
},
155
+
-- required for Windows users
156
+
use_absolute_path = true,
157
+
},
158
+
},
159
+
},
160
+
{
161
+
-- Make sure to set this up properly if you have lazy=true
0 commit comments