Skip to content

Commit 98c538a

Browse files
chore: auto-generate vimdoc
1 parent 08bcfb6 commit 98c538a

File tree

1 file changed

+83
-6
lines changed

1 file changed

+83
-6
lines changed

doc/gp.nvim.txt

Lines changed: 83 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*gp.nvim.txt* For NVIM v0.8.0 Last change: 2024 May 28
1+
*gp.nvim.txt* For NVIM v0.8.0 Last change: 2024 July 09
22

33
==============================================================================
44
Table of Contents *gp.nvim-table-of-contents*
@@ -7,8 +7,9 @@ Table of Contents *gp.nvim-table-of-contents*
77
2. Install |gp.nvim-install|
88
- 1. Install the plugin |gp.nvim-1.-install-the-plugin|
99
- 2. OpenAI API key |gp.nvim-2.-openai-api-key|
10-
- 3. Dependencies |gp.nvim-3.-dependencies|
11-
- 4. Configuration |gp.nvim-4.-configuration|
10+
- 3. Multiple providers |gp.nvim-3.-multiple-providers|
11+
- 4. Dependencies |gp.nvim-4.-dependencies|
12+
- 5. Configuration |gp.nvim-5.-configuration|
1213
3. Usage |gp.nvim-usage|
1314
- Chat commands |gp.nvim-chat-commands|
1415
- Text/Code commands |gp.nvim-text/code-commands|
@@ -49,7 +50,7 @@ reusing and integrating well with the natural features of (Neo)vim.
4950
- properly working undo (response can be undone with a single `u`)
5051
- **Infinitely extensible** via hook functions specified as part of the config
5152
- hooks have access to everything in the plugin and are automatically registered as commands
52-
- see |gp.nvim-4.-configuration| and |gp.nvim-extend-functionality| sections for details
53+
- see |gp.nvim-5.-configuration| and |gp.nvim-extend-functionality| sections for details
5354
- **Minimum dependencies** (`neovim`, `curl`, `grep` and optionally `sox`)
5455
- zero dependencies on other lua plugins to minimize chance of breakage
5556
- **ChatGPT like sessions**
@@ -151,7 +152,83 @@ If `openai_api_key` is a table, Gp runs it asynchronously to avoid blocking
151152
Neovim (password managers can take a second or two).
152153

153154

154-
3. DEPENDENCIES *gp.nvim-3.-dependencies*
155+
3. MULTIPLE PROVIDERS *gp.nvim-3.-multiple-providers*
156+
157+
The following LLM providers are currently supported besides OpenAI:
158+
159+
- Ollama <https://github.com/ollama/ollama> for local/offline open-source models. The plugin assumes you have the Ollama service up and running with configured models available (the default Ollama agent uses Llama3).
160+
- GitHub Copilot <https://github.com/settings/copilot> with a Copilot license (zbirenbaum/copilot.lua <https://github.com/zbirenbaum/copilot.lua> or github/copilot.vim <https://github.com/github/copilot.vim> for autocomplete). You can access the underlying GPT-4 model without paying anything extra (essentially unlimited GPT-4 access).
161+
- Perplexity.ai <https://www.perplexity.ai/pro> Pro users have $5/month free API credits available (the default PPLX agent uses Mixtral-8x7b).
162+
- Anthropic <https://www.anthropic.com/api> to access Claude models, which currently outperform GPT-4 in some benchmarks.
163+
- Google Gemini <https://ai.google.dev/> with a quite generous free range but some geo-restrictions (EU).
164+
- Any other "OpenAI chat/completions" compatible endpoint (Azure, LM Studio, etc.)
165+
166+
Below is an example of the relevant configuration part enabling some of these.
167+
The `secret` field has the same capabilities as `openai_api_key` (which is
168+
still supported for compatibility).
169+
170+
>lua
171+
providers = {
172+
openai = {
173+
endpoint = "https://api.openai.com/v1/chat/completions",
174+
secret = os.getenv("OPENAI_API_KEY"),
175+
},
176+
177+
-- azure = {...},
178+
179+
copilot = {
180+
endpoint = "https://api.githubcopilot.com/chat/completions",
181+
secret = {
182+
"bash",
183+
"-c",
184+
"cat ~/.config/github-copilot/hosts.json | sed -e 's/.*oauth_token...//;s/\".*//'",
185+
},
186+
},
187+
188+
pplx = {
189+
endpoint = "https://api.perplexity.ai/chat/completions",
190+
secret = os.getenv("PPLX_API_KEY"),
191+
},
192+
193+
ollama = {
194+
endpoint = "http://localhost:11434/v1/chat/completions",
195+
},
196+
197+
googleai = {
198+
endpoint = "https://generativelanguage.googleapis.com/v1beta/models/{{model}}:streamGenerateContent?key={{secret}}",
199+
secret = os.getenv("GOOGLEAI_API_KEY"),
200+
},
201+
202+
anthropic = {
203+
endpoint = "https://api.anthropic.com/v1/messages",
204+
secret = os.getenv("ANTHROPIC_API_KEY"),
205+
},
206+
},
207+
<
208+
209+
Each of these providers has some agents preconfigured. Below is an example of
210+
how to disable predefined ChatGPT3-5 agent and create a custom one. If the
211+
`provider` field is missing, OpenAI is assumed for backward compatibility.
212+
213+
>lua
214+
agents = {
215+
{
216+
name = "ChatGPT3-5",
217+
disable = true,
218+
},
219+
{
220+
name = "MyCustomAgent",
221+
provider = "copilot",
222+
chat = true,
223+
command = true,
224+
model = { model = "gpt-4-turbo" },
225+
system_prompt = "Answer any query with just: Sure thing..",
226+
},
227+
},
228+
<
229+
230+
231+
4. DEPENDENCIES *gp.nvim-4.-dependencies*
155232

156233
The core plugin only needs `curl` installed to make calls to OpenAI API and
157234
`grep` for ChatFinder. So Linux, BSD and Mac OS should be covered.
@@ -166,7 +243,7 @@ recording and processing:
166243
- NixOS: `nix-env -i sox`
167244

168245

169-
4. CONFIGURATION *gp.nvim-4.-configuration*
246+
5. CONFIGURATION *gp.nvim-5.-configuration*
170247

171248
Bellow is a linked snippet with the default values, but I suggest starting with
172249
minimal config possible (just `openai_api_key` if you don’t have

0 commit comments

Comments
 (0)