File tree Expand file tree Collapse file tree
codecompanion/_extensions/vectorcode
vectorcode/integrations/codecompanion/prompts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -284,9 +284,12 @@ The `query` tool contains the following extra config options:
284284#### Prompt Library
285285
286286On VectorCode 0.7.16+ and CodeCompanion.nvim 17.20.0+, VectorCode also provides a
287- customisable prompt library that helps you RAG local directories. The following is the
288- a preset that vectorises the lua source code and help files in the neovim runtime
289- directory.
287+ customisable prompt library that helps you RAG local directories. The presets
288+ provided by VectorCode are available
289+ [ here] ( ../../lua/vectorcode/integrations/codecompanion/prompts/presets.lua ) , which
290+ you can refer to if you wish to build local RAG APPs with CodeCompanion.nvim and
291+ VectorCode.
292+
290293``` lua
291294require (' codecompanion' ).setup {
292295 extensions = {
@@ -297,6 +300,10 @@ require('codecompanion').setup{
297300 prompt_library = {
298301 {
299302 [" Neovim Tutor" ] = {
303+ -- this is for demonstration only.
304+ -- "Neovim Tutor" is shipped with this plugin
305+ -- and you don't need to add it in the config
306+ -- unless you're not happy with the defaults.
300307 project_root = vim .env .VIMRUNTIME ,
301308 file_patterns = { " lua/**/*.lua" , " doc/**/*.txt" },
302309 -- system_prompt = ...,
Original file line number Diff line number Diff line change 1818
1919local vc_config = require (" vectorcode.config" )
2020local logger = vc_config .logger
21- local vim_runtime = vim .fs .normalize (vim .env .VIMRUNTIME )
2221
2322--- @type VectorCode.CodeCompanion.ExtensionOpts |{}
2423local default_extension_opts = {
@@ -34,12 +33,7 @@ local default_extension_opts = {
3433 },
3534 tool_group = { enabled = true , collapse = true , extras = {} },
3635
37- prompt_library = {
38- [" Neovim Tutor" ] = {
39- project_root = vim_runtime ,
40- file_patterns = { " lua/**/*.lua" , " doc/**/*.txt" },
41- },
42- },
36+ prompt_library = require (" vectorcode.integrations.codecompanion.prompts.presets" ),
4337}
4438
4539--- @type sub_cmd[]
Original file line number Diff line number Diff line change 1+ --- @type table<string , VectorCode.CodeCompanion.PromptFactory.Opts>
2+ local M = {}
3+
4+ M [" Neovim Tutor" ] = {
5+ project_root = vim .fs .normalize (vim .env .VIMRUNTIME ),
6+ file_patterns = { " lua/**/*.lua" , " doc/**/*.txt" },
7+ }
8+
9+ return M
You can’t perform that action at this time.
0 commit comments