Refreshing variables content after each request #1234
-
This is how I defined my ["timestamp"] = {
---Ensure the file matches the CodeCompanion.Variable class
---@return string|fun(): nil
-- callback = "/Users/Oli/Code/my_var.lua",
callback = function()
local string = os.date("%Y-%m-%d %H:%M:%S") .. " This is the XXX timestamp"
vim.notify(vim.inspect(string), "info", { title = "[timestamp]" })
return string
end,
description = "Get timestamp",
-- opts = {
-- contains_code = false,
-- },
}, Once I do a first LLM request this way:
Then the But if I later do another request, then How could I be sure that, once a Please note that This is a sample conversation, you can see that at first input it properly detected the
In short, I would like that each time the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is a very valid question. It's not possible to do this with custom variables. It's been implemented for buffers (via watchers and pins) but no plans to add this in. I'm planning to add some keymaps to trigger slash commands in the near future which will make adding repeated context like this a little less painful. |
Beta Was this translation helpful? Give feedback.
This is a very valid question. It's not possible to do this with custom variables. It's been implemented for buffers (via watchers and pins) but no plans to add this in.
I'm planning to add some keymaps to trigger slash commands in the near future which will make adding repeated context like this a little less painful.