We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db2d120 commit 825f5eaCopy full SHA for 825f5ea
lua/codecompanion/strategies/chat/agents/init.lua
@@ -283,10 +283,15 @@ function Agent:parse(chat, message)
283
284
if groups and not vim.tbl_isempty(groups) then
285
for _, group in ipairs(groups) do
286
- if self.tools_config.groups[group].system_prompt then
+ local schema = self.tools_config.groups[group]
287
+ local system_prompt = schema.system_prompt
288
+ if type(system_prompt) == "function" then
289
+ system_prompt = system_prompt(schema)
290
+ end
291
+ if system_prompt then
292
chat:add_message({
293
role = config.constants.SYSTEM_ROLE,
- content = self.tools_config.groups[group].system_prompt,
294
+ content = system_prompt,
295
}, { tag = "tool", visible = false })
296
end
297
0 commit comments