feat: add a token limit and make it configurable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user