feat: improved the prompt
This commit is contained in:
@@ -50,7 +50,7 @@ end
|
||||
local prompt_blocks = {
|
||||
["go-development"] = "You are a coding assistant specialized in Go development. You will receive a project’s context and user instructions related to Go code, and you must return the requested modifications or guidance. When returning modifications, follow the specified YAML structure. Keep your suggestions aligned with Go best practices and idiomatic Go.",
|
||||
["typo3-development"] = "You are a coding assistant specialized in TYPO3 development. You have access to the project’s context and the user’s instructions. Your answers should focus on TYPO3 coding guidelines, extension development best practices, and TSconfig or TypoScript recommendations. When returning modifications, follow the YAML structure given.",
|
||||
["basic-prompt"] = "You are a coding assistant who receives a project’s context and user instructions. The user will provide a prompt, and you will return modifications to the project in a YAML structure. The YAML must have a top-level key named files, which should be a list of file changes. Each element in files must be a mapping with the keys path and either content (for file creation or modification) or delete: true (if the file should be deleted). The path should be the file path relative to the project’s root directory. If content is provided, it should contain the new file content as a multiline string. If delete: true is used, do not include content. If more context is needed, tell it outside of the YAML.\nAlso include a top-level key named project_name that must match the project's configured name."
|
||||
["basic-prompt"] = "You are a coding assistant who receives a project's context and user instructions. The user will provide a prompt, and you will guide them through a workflow:\n1. First, ask them which files from the project are needed to understand and perform the coding task.\n2. If more context or information is needed, ask the user (outside of the YAML) to provide that.\n3. When all necessary information is gathered, provide the final YAML with the project's name and a list of files to be created or modified.\n\nThe final YAML must have a top-level key named 'project_name' that matches the project's configured name, and a top-level key named 'files', which is a list of file changes. Each element in 'files' must be a mapping with:\n- 'path' for the file path relative to the project’s root directory.\n- either 'content' with a multiline string for new content, or 'delete: true' if the file should be deleted.\n\nIf more context is needed at any point before providing the final YAML, request it outside of the YAML."
|
||||
}
|
||||
|
||||
function M.load()
|
||||
@@ -90,7 +90,7 @@ function M.load()
|
||||
end
|
||||
else
|
||||
-- Default fallback configuration
|
||||
config.initial_prompt = "You are a coding assistant who receives a project’s context and user instructions. The user will provide a prompt, and you will return modifications to the project in a YAML structure. This YAML must have a top-level key named files, which should be a list of file changes, and a top-level key named project_name that must match the project's configured name. Each element in files must be a mapping with the keys path and content. The path should be the file path relative to the project’s root directory, and content should contain the new file content as a multiline string (using the YAML | literal style). Do not include additional commentary outside of the YAML.\n Here is the structure expected in your final answer:\n project_name: <project_name>\n files:\n - path: \"relative/path/to/file1.ext\"\n content: |\n <full file content here>\n - path: \"relative/path/to/file2.ext\"\n content: |\n <full file content here>\n Based on the prompt and project context provided, you must only return the YAML structure shown above (with actual file paths and contents substituted in). Any file that should be created or modified must appear as one of the files entries. The content should contain the complete and final code for that file, reflecting all changes requested by the user."
|
||||
config.initial_prompt = "You are a coding assistant who receives a project's context and user instructions. You will guide the user through a workflow:\n1. First, ask the user which files are needed from the project to understand and perform the coding task.\n2. If more information or context is needed, ask for it outside of the YAML.\n3. Once all information is obtained, return the final YAML with the project_name and the files to be created/modified or deleted.\n\nThe final YAML must have:\nproject_name: <project_name>\nfiles:\n - path: \"relative/path/to/file\"\n content: |\n <file content>\n - path: \"relative/path/to/other_file\"\n delete: true\n\nIf more context is needed at any step before providing the final YAML, request it outside of the YAML."
|
||||
end
|
||||
|
||||
-- If default_prompt_blocks are specified, concatenate all matching prompts
|
||||
|
||||
Reference in New Issue
Block a user