Skip to content

Commit 2abf925

Browse files
committed
fix: remove unused model param from context resolving
The model parameter was unused in context resolution functions and has been removed to simplify the API. This change affects both the type definition and implementation of context resolving functions.
1 parent 50ca1e2 commit 2abf925

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lua/CopilotChat/config/contexts.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local utils = require('CopilotChat.utils')
55
---@class CopilotChat.config.context
66
---@field description string?
77
---@field input fun(callback: fun(input: string?), source: CopilotChat.source)?
8-
---@field resolve fun(input: string?, source: CopilotChat.source, prompt: string, model: string):table<CopilotChat.context.embed>
8+
---@field resolve fun(input: string?, source: CopilotChat.source, prompt: string):table<CopilotChat.context.embed>
99

1010
---@type table<string, CopilotChat.config.context>
1111
return {

lua/CopilotChat/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,9 @@ end
219219

220220
--- Resolve the embeddings from the prompt.
221221
---@param prompt string
222-
---@param model string
223222
---@param config CopilotChat.config.shared
224223
---@return table<CopilotChat.context.embed>, string
225-
function M.resolve_embeddings(prompt, model, config)
224+
function M.resolve_embeddings(prompt, config)
226225
local contexts = {}
227226
local function parse_context(prompt_context)
228227
local split = vim.split(prompt_context, ':')
@@ -262,7 +261,7 @@ function M.resolve_embeddings(prompt, model, config)
262261
for _, context_data in ipairs(contexts) do
263262
local context_value = M.config.contexts[context_data.name]
264263
for _, embedding in
265-
ipairs(context_value.resolve(context_data.input, state.source or {}, prompt, model))
264+
ipairs(context_value.resolve(context_data.input, state.source or {}, prompt))
266265
do
267266
if embedding then
268267
embeddings:set(embedding.filename, embedding)

0 commit comments

Comments
 (0)