Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lua/vectorcode/integrations/codecompanion/query_tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local logger = vc_config.logger

local job_runner = nil

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

---@alias chat_id integer
---@alias result_id string
Expand Down Expand Up @@ -114,7 +114,7 @@ local function generate_summary(result, summarise_opts, cmd, callback)
end)
:totable())

if summarise_opts.enabled and type(callback) == "function" then
if summarise_opts.enabled and cmd.allow_summary and type(callback) == "function" then
---@type CodeCompanion.Adapter
local adapter =
vim.deepcopy(require("codecompanion.adapters").resolve(summarise_opts.adapter))
Expand Down Expand Up @@ -342,8 +342,16 @@ If a query returned empty or repeated results, you should avoid using these quer
type = "string",
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.",
},
allow_summary = {
type = "boolean",
description = [[
When this option is set to `true`, you're allowing the retrieval results to be summarised.
Leave this to `true` by default.
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.
]],
},
},
required = { "query", "count", "project_root" },
required = { "query", "count", "project_root", "allow_summary" },
additionalProperties = false,
},
strict = true,
Expand Down