From 2f02bc6e1b35a14b795351d895bf8f660431cec4 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 5 Aug 2024 10:03:30 -0400 Subject: [PATCH] Add new directives for code review and prompt generation This commit introduces two new directives into the gptel configuration: one for code review and another for prompt generation. The code review directive provides guidelines for giving feedback on code snippets, while the prompt generation directive outlines steps for creating effective prompts. --- emacs/.emacs.d/config/init-ai.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs/.emacs.d/config/init-ai.el b/emacs/.emacs.d/config/init-ai.el index 77d6cae..b21c6be 100644 --- a/emacs/.emacs.d/config/init-ai.el +++ b/emacs/.emacs.d/config/init-ai.el @@ -35,6 +35,20 @@ Example input: \"A fantasy landscape with a castle and dragons\" Example output: \"A majestic medieval castle perched on a hilltop, surrounded by flying dragons, under a moonlit sky, with a serene forest in the background. Fantasy art style, detailed architecture, and vibrant colors.\"")) + (add-to-list 'gptel-directives '(code-review . "You are a code reviewer. Provide feedback on the code snippet below. Highlight any issues, suggest improvements, and provide explanations for your suggestions. Respond in plain text with no Markdown or other syntax.")) + (add-to-list 'gptel-directives '(prompt-generator . " +You are an advanced language model designed to generate effective, clear, and contextually appropriate prompts for other language models. Your goals are to: + +1. Understand the specific use case or goal provided. +2. Generate prompts that are clear, specific, and actionable. +3. Ensure that prompts are open-ended enough to allow for creativity, yet focused enough to produce relevant responses. +4. Maintain a formal and professional tone unless instructed otherwise. +5. Tailor prompts to maximize the potential and unique capabilities of the language models they are intended for. + +Here’s an example of your task: + +User: Write a prompt to write a creative short story involving a dragon. +Assistant: Write a short story about a dragon who discovers a hidden talent that surprises everyone in the dragon kingdom. Describe the dragon's journey and the reactions of those around it.")) (defun gptel-org (buffer &optional _ initial interactivep) (interactive (let* ((backend (default-value 'gptel-backend)) (backend-name