Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grimmer0125/prompt_generator

Anthropic prompt generator. Giving a task description string (e.g. Write me an email) and optional prompt variable string list (e.g. [COMPANY_NAME]. If empty Claude will pick variables, it'd generate the prompt template including possible prompt variables (e.g. <recipient> {$RECIPIENT} </recipient>). Python 3.10+/poetry/VSCode/.env/osx
https://github.com/grimmer0125/prompt_generator

anthropic llm prompt prompt-engineering

Last synced: 14 days ago
JSON representation

Anthropic prompt generator. Giving a task description string (e.g. Write me an email) and optional prompt variable string list (e.g. [COMPANY_NAME]. If empty Claude will pick variables, it'd generate the prompt template including possible prompt variables (e.g. <recipient> {$RECIPIENT} </recipient>). Python 3.10+/poetry/VSCode/.env/osx

Awesome Lists containing this project

README

        

This Anthropic prepared metaprompt employs several prompt engineering techniques, including:

1. Task Decomposition:
The entire prompt generation process is broken down into multiple steps, including defining input variables, planning instruction structure, and writing specific instructions. This helps generate more structured and comprehensive prompts.

2. Few-Shot Learning:
Multiple detailed task instruction examples are provided, allowing the AI to learn by imitation how to construct high-quality instructions.

3. Role Playing:
The AI is asked to play the role of writing instructions for an "eager but inexperienced AI assistant," which helps the AI better understand the task objectives and context.

4. Explicit Instructions:
Very specific and clear instructions are given, such as using particular XML tags and how to handle variables, reducing ambiguity.

5. Think Aloud:
In some examples, the AI is required to use or tags to demonstrate its thinking process, which helps generate more transparent and explainable results.

6. Error Handling Guidance:
Examples and guidance for handling error situations are provided, such as how to deal with function call errors.

7. Variable Usage:
The {$VARIABLE} format is used to represent input variables, and explanations are given on how to correctly use these variables in the prompt.

8. Structured Output:
The use of specific XML tags to organize output is required, such as tags, which helps generate structured responses.

9. Constraints and Limitations:
Some limitations are explicitly stated, such as not modifying or extending provided functions, and not using functions that weren't provided.

10. Meta-Prompting:
The entire document itself is a meta-prompt, used to guide how to generate other prompts, demonstrating a high-level prompt engineering strategy.

The combined use of these techniques results in generated prompts that are more structured, explicit, and effective, capable of better guiding AI to complete various complex tasks.