feat: add a token limit and make it configurable

This commit is contained in:
2024-12-12 22:46:32 +01:00
parent 9a9868c991
commit 00a52998b8
2 changed files with 22 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
-- 1) Determine the Git root based on the currently opened file.
-- 2) If no file is open or not in Git repo, fallback to current working directory.
-- 3) Add support for configuring a list of default prompt blocks ("go-development", "typo3-development", "basic-prompt") that can override the initial prompt if provided.
-- 4) Add support for configuring a token limit.
local M = {}
local uv = vim.loop
@@ -57,7 +58,8 @@ function M.load()
local config = {
initial_prompt = "",
directories = { "." },
default_prompt_blocks = {}
default_prompt_blocks = {},
token_limit = 128000
}
if fd then
@@ -76,6 +78,9 @@ function M.load()
if type(result.default_prompt_blocks) == "table" then
config.default_prompt_blocks = result.default_prompt_blocks
end
if type(result.token_limit) == "number" then
config.token_limit = result.token_limit
end
end
end
else