fix: add project name to initial prompt, improve basic prompt

This commit is contained in:
2025-01-31 15:09:10 +01:00
parent d5b05ede36
commit 50ba937ae0
2 changed files with 7 additions and 1 deletions

View File

@@ -173,6 +173,12 @@ function M.load()
end end
end end
-- Include project name in the final initial prompt, if set
if config.project_name ~= "" then
config.initial_prompt =
"[Project Name: " .. config.project_name .. "]\n\n" .. config.initial_prompt
end
if config.debug then if config.debug then
vim.api.nvim_out_write("[chatgpt_nvim:config] Loaded config from: " .. path .. "\n") vim.api.nvim_out_write("[chatgpt_nvim:config] Loaded config from: " .. path .. "\n")
vim.api.nvim_out_write("[chatgpt_nvim:config] Debug logging is enabled.\n") vim.api.nvim_out_write("[chatgpt_nvim:config] Debug logging is enabled.\n")

View File

@@ -289,7 +289,7 @@ local M = {
- If multiple tools are needed, list them sequentially in the `tools` array. - If multiple tools are needed, list them sequentially in the `tools` array.
- Always run at least one tool (e.g., `readFile`, `editFile`, `executeCommand`), exept you have finished. - Always run at least one tool (e.g., `readFile`, `editFile`, `executeCommand`), exept you have finished.
- Always just include one yaml in the response with all the tools you want to run in that yaml. - Always just include one yaml in the response with all the tools you want to run in that yaml.
- Never do write operations on a file which you have not read before. - Never do write operations on a file which you have not read before. Its contents must be in your context before writing. This does not apply if you create a new file.
- The plugin will verify the `project_name` is correct before running any tools. - The plugin will verify the `project_name` is correct before running any tools.
- If the response grows too large, I'll guide you to break it into smaller steps. - If the response grows too large, I'll guide you to break it into smaller steps.
]], ]],