-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathconfig.lua
More file actions
66 lines (58 loc) · 2.63 KB
/
Copy pathconfig.lua
File metadata and controls
66 lines (58 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
return {
{
"Kurama622/llm.nvim",
dependencies = { "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim" },
cmd = { "LLMSessionToggle", "LLMSelectedTextHandler", "LLMAppHandler" },
config = function()
require("llm").setup({
-- [[ Requesty ]]
-- Requesty (https://requesty.ai) is an OpenAI-compatible LLM gateway.
-- Set LLM_KEY to your Requesty API key (https://app.requesty.ai/router).
url = "https://router.requesty.ai/v1/chat/completions",
model = "openai/gpt-4o-mini",
api_type = "openai",
max_tokens = 4096,
temperature = 0.3,
top_p = 0.7,
prompt = "You are a helpful assistant.",
prefix = {
user = { text = "😃 ", hl = "Title" },
assistant = { text = " ", hl = "Added" },
},
-- history_path = "/tmp/llm-history",
save_session = true,
max_history = 15,
max_history_name_length = 20,
-- stylua: ignore
keys = {
-- The keyboard mapping for the input window.
["Input:Submit"] = { mode = "n", key = "<cr>" },
["Input:Cancel"] = { mode = {"n", "i"}, key = "<C-c>" },
["Input:Resend"] = { mode = {"n", "i"}, key = "<C-r>" },
-- only works when "save_session = true"
["Input:HistoryNext"] = { mode = {"n", "i"}, key = "<C-j>" },
["Input:HistoryPrev"] = { mode = {"n", "i"}, key = "<C-k>" },
-- The keyboard mapping for the output window in "split" style.
["Output:Ask"] = { mode = "n", key = "i" },
["Output:Cancel"] = { mode = "n", key = "<C-c>" },
["Output:Resend"] = { mode = "n", key = "<C-r>" },
-- The keyboard mapping for the output and input windows in "float" style.
["Session:Toggle"] = { mode = "n", key = "<leader>ac" },
["Session:Close"] = { mode = "n", key = {"<esc>", "Q"} },
-- Scroll
["PageUp"] = { mode = {"i","n"}, key = "<C-b>" },
["PageDown"] = { mode = {"i","n"}, key = "<C-f>" },
["HalfPageUp"] = { mode = {"i","n"}, key = "<C-u>" },
["HalfPageDown"] = { mode = {"i","n"}, key = "<C-d>" },
["JumpToTop"] = { mode = "n", key = "gg" },
["JumpToBottom"] = { mode = "n", key = "G" },
},
})
end,
keys = {
{ "<leader>ac", mode = "n", "<cmd>LLMSessionToggle<cr>" },
{ "<leader>ae", mode = "v", "<cmd>LLMSelectedTextHandler Explain the following code<cr>" },
{ "<leader>ts", mode = "x", "<cmd>LLMSelectedTextHandler Translate into English<cr>" },
},
},
}