Skip to content

Commit e8170f8

Browse files
committed
feat(nvim): Add allow_summary option to the query tool
1 parent f9e48b7 commit e8170f8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lua/vectorcode/integrations/codecompanion/query_tool.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local logger = vc_config.logger
1010

1111
local job_runner = nil
1212

13-
---@alias QueryToolArgs { project_root:string, count: integer, query: string[] }
13+
---@alias QueryToolArgs { project_root:string, count: integer, query: string[], allow_summary: boolean }
1414

1515
---@alias chat_id integer
1616
---@alias result_id string
@@ -114,7 +114,7 @@ local function generate_summary(result, summarise_opts, cmd, callback)
114114
end)
115115
:totable())
116116

117-
if summarise_opts.enabled and type(callback) == "function" then
117+
if summarise_opts.enabled and cmd.allow_summary and type(callback) == "function" then
118118
---@type CodeCompanion.Adapter
119119
local adapter =
120120
vim.deepcopy(require("codecompanion.adapters").resolve(summarise_opts.adapter))
@@ -342,8 +342,16 @@ If a query returned empty or repeated results, you should avoid using these quer
342342
type = "string",
343343
description = "Project path to search within (must be from 'ls' results or user instructions). Use empty string for the current project. If the user did not specify a project, assume that they're referring to the current project and use an empty string for this parameter. If this fails, use the `vectorcode_ls` tool and ask the user to clarify the project.",
344344
},
345+
allow_summary = {
346+
type = "boolean",
347+
description = [[
348+
When this option is set to `true`, you're allowing the retrieval results to be summarised.
349+
Leave this to `true` by default.
350+
Set this to `false` only if you've been instructed by the user to not enable summarisation, or if the summary is missing information that you'd need for the current task.
351+
]],
352+
},
345353
},
346-
required = { "query", "count", "project_root" },
354+
required = { "query", "count", "project_root", "allow_summary" },
347355
additionalProperties = false,
348356
},
349357
strict = true,

0 commit comments

Comments
 (0)