refactor: remove use_xml_format (#1535)

This commit is contained in:
yetone
2025-03-09 14:58:30 +08:00
committed by GitHub
parent 510bf2ff35
commit 868c136574
17 changed files with 75 additions and 102 deletions

View File

@@ -114,7 +114,6 @@ function M.generate_prompts(opts)
local system_info = Utils.get_system_info()
local template_opts = {
use_xml_format = provider.use_xml_format,
ask = opts.ask, -- TODO: add mode without ask instruction
code_lang = opts.code_lang,
selected_files = opts.selected_files,
@@ -156,11 +155,7 @@ function M.generate_prompts(opts)
end
if instructions then
if opts.use_xml_format then
table.insert(messages, { role = "user", content = string.format("<question>%s</question>", instructions) })
else
table.insert(messages, { role = "user", content = string.format("QUESTION:\n%s", instructions) })
end
table.insert(messages, { role = "user", content = string.format("<question>%s</question>", instructions) })
end
local remaining_tokens = max_tokens - Utils.tokens.calculate_tokens(system_prompt)