|
53 | 53 |
|
54 | 54 | ---Options for the registration of an async cache for a buffer. |
55 | 55 | ---@class VectorCode.RegisterOpts: VectorCode.QueryOpts |
56 | | ----@field debounce integer? Seconds. Default: 10 |
57 | | ----@field events string|string[]|nil autocmd events that triggers async jobs. Default: `{"BufWritePost", "InsertEnter", "BufReadPost"}` |
58 | | ----@field single_job boolean? Whether to restrict to 1 async job per buffer. Default: false |
59 | | ----@field query_cb VectorCode.QueryCallback? Function that accepts the buffer ID and returns the query message(s). Default: `require("vectorcode.utils").make_surrounding_lines_cb(-1)` |
60 | | ----@field run_on_register boolean? Whether to run the query when registering. Default: false |
61 | | ----@field project_root string? |
| 56 | +---@field debounce? integer Seconds. Default: 10 |
| 57 | +---@field events? string|string[] autocmd events that triggers async jobs. Default: `{"BufWritePost", "InsertEnter", "BufReadPost"}` |
| 58 | +---@field single_job? boolean Whether to restrict to 1 async job per buffer. Default: false |
| 59 | +---@field query_cb? VectorCode.QueryCallback Function that accepts the buffer ID and returns the query message(s). Default: `require("vectorcode.utils").make_surrounding_lines_cb(-1)` |
| 60 | +---@field run_on_register? boolean Whether to run the query when registering. Default: false |
| 61 | +---@field project_root? string |
62 | 62 |
|
63 | 63 | ---A unified interface used by `lsp` backend and `default` backend |
64 | 64 | ---@class VectorCode.CacheBackend |
|
96 | 96 | --- Users may ask the LLM to request a different number of results in the chat. |
97 | 97 | --- You may set this to a table to configure different values for document/chunk mode. |
98 | 98 | --- Default: `{ document = 10, chunk = 50 }` |
99 | | ----@field default_num integer|{document:integer, chunk: integer}|nil |
| 99 | +---@field default_num? integer|{document:integer, chunk: integer} |
100 | 100 | --- Whether to avoid duplicated references. Default: `true` |
101 | 101 | ---@field no_duplicate boolean? |
102 | 102 | --- Whether to send chunks instead of full files to the LLM. Default: `false` |
103 | 103 | --- > Make sure you adjust `max_num` and `default_num` accordingly. |
104 | | ----@field chunk_mode boolean? |
105 | | ----@field summarise VectorCode.CodeCompanion.SummariseOpts? |
| 104 | +---@field chunk_mode? boolean |
| 105 | +---@field summarise? VectorCode.CodeCompanion.SummariseOpts |
106 | 106 |
|
107 | 107 | ---@class VectorCode.CodeCompanion.VectoriseToolOpts: VectorCode.CodeCompanion.ToolOpts |
108 | 108 |
|
109 | 109 | ---@class VectorCode.CodeCompanion.ToolGroupOpts |
110 | | ---- Whether to register the tool group |
111 | | ----@field enabled boolean |
112 | | ---- Whether to show the individual tools in the references |
113 | | ----@field collapse boolean |
114 | | ---- Other tools that you'd like to include in `vectorcode_toolbox` |
115 | | ----@field extras string[] |
| 110 | +---Whether to register the tool group |
| 111 | +---@field enabled? boolean |
| 112 | +---Whether to show the individual tools in the references |
| 113 | +---@field collapse? boolean |
| 114 | +---Other tools that you'd like to include in `vectorcode_toolbox` |
| 115 | +---@field extras? string[] |
116 | 116 |
|
117 | 117 | --- The result of the query tool should be structured in the following table |
118 | 118 | ---@class VectorCode.CodeCompanion.QueryToolResult |
119 | 119 | ---@field raw_results VectorCode.QueryResult[] |
120 | 120 | ---@field count integer |
121 | | ----@field summary string|nil |
| 121 | +---@field summary? string |
122 | 122 |
|
123 | 123 | ---@class VectorCode.CodeCompanion.SummariseOpts |
124 | 124 | ---A boolean flag that controls whether summarisation should be enabled. |
|
128 | 128 | ---This function recieves 2 parameters: |
129 | 129 | --- - `CodeCompanion.Chat`: the chat object; |
130 | 130 | --- - `VectorCode.QueryResult[]`: a list of query results. |
131 | | ----@field enabled boolean|(fun(chat: CodeCompanion.Chat, results: VectorCode.QueryResult[]):boolean)|nil |
| 131 | +---@field enabled? boolean|(fun(chat: CodeCompanion.Chat, results: VectorCode.QueryResult[]):boolean) |
132 | 132 | ---The adapter used for the summarisation task. When set to `nil`, the adapter from the current chat will be used. |
133 | | ----@field adapter string|CodeCompanion.HTTPAdapter|fun():CodeCompanion.HTTPAdapter|nil |
| 133 | +---@field adapter? string|CodeCompanion.HTTPAdapter|fun():CodeCompanion.HTTPAdapter |
134 | 134 | ---The system prompt sent to the summariser model. |
135 | 135 | ---When set to a function, it'll recieve the default system prompt as the only parameter, |
136 | 136 | ---and should return the new (full) system prompt. This allows you to customise or rewrite the system prompt. |
137 | | ----@field system_prompt string|(fun(original_prompt: string): string) |
| 137 | +---@field system_prompt? string|(fun(original_prompt: string): string) |
138 | 138 | ---When set to true, include the query messages so that the LLM may make task-related summarisations. |
139 | 139 | ---This happens __after__ the `system_prompt` callback processing |
140 | | ----@field query_augmented boolean |
| 140 | +---@field query_augmented? boolean |
0 commit comments