-
-
Save adeptusnull/a9119a9ef9821999aa5ec7de0ea4956d to your computer and use it in GitHub Desktop.
Revisions
-
disler revised this gist
Nov 24, 2024 . No changes.There are no files selected for viewing
-
disler renamed this gist
Nov 24, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
disler created this gist
Nov 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # Four Level framework for prompt engineering > Watch the breakdown here in a [Q4 2024 prompt engineering update video](https://youtu.be/ujnLJru2LIs) > > [LLM library](https://github.com/simonw/llm) > > [Ollama](https://ollama.com/) ## Level 1: Ad hoc prompt - Quick, natural language prompts for rapid prototyping - Perfect for exploring model capabilities and behaviors - Can be run across multiple models for comparison - Great for one-off tasks and experimentation ## Level 2: Structured prompt - Reusable prompts with clear purpose and instructions - Uses XML/structured format for better model performance - Contains static variables that can be modified - Solves well-defined, repeatable problems ## Level 3: Structured prompt with example output - Builds on Level 2 by adding example outputs - Examples guide the model to produce specific formats - Increases consistency and reliability of outputs - Perfect for when output format matters ## Level 4: Structured prompt with dynamic content - Production-ready prompts with dynamic variables - Can be integrated into code and applications - Infinitely scalable through programmatic updates - Foundation for building AI-powered tools and agents This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ <purpose> Summarize the given content based on the instructions and example-output </purpose> <instructions> <instruction>Output in markdown format</instruction> <instruction>Summarize into 4 sections: High level summary, Main Points, Sentiment, and 3 hot takes biased toward the author and 3 hot takes biased against the author</instruction> <instruction>Write the summary in the same format as the example-output</instruction> </instructions> <content> {...} <<< update this manually </content> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ <purpose> Summarize the given content based on the instructions and example-output </purpose> <instructions> <instruction>Output in markdown format</instruction> <instruction>Summarize into 4 sections: High level summary, Main Points, Sentiment, and 3 hot takes biased toward the author and 3 hot takes biased against the author</instruction> <instruction>Write the summary in the same format as the example-output</instruction> </instructions> <example-output> # Title ## High Level Summary ... ## Main Points ... ## Sentiment ... ## Hot Takes (biased toward the author) ... ## Hot Takes (biased against the author) ... </example-output> <content> {...} <<< update this manually </content> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ <purpose> Summarize the given content based on the instructions and example-output </purpose> <instructions> <instruction>Output in markdown format</instruction> <instruction>Summarize into 4 sections: High level summary, Main Points, Sentiment, and 3 hot takes biased toward the author and 3 hot takes biased against the author</instruction> <instruction>Write the summary in the same format as the example-output</instruction> </instructions> <example-output> # Title ## High Level Summary ... ## Main Points ... ## Sentiment ... ## Hot Takes (biased toward the author) ... ## Hot Takes (biased against the author) ... </example-output> <content> {{content}} <<< update this dynamically with code </content> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Summarize the content with 3 hot takes biased toward the author and 3 hot takes biased against the author ...paste content here... This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ { "XML Prompt Block 1": { "prefix": "px1", "body": [ "<purpose>", " $1", "</purpose>", "", "<instructions>", " <instruction>$2</instruction>", " <instruction>$3</instruction>", " <instruction>$4</instruction>", "</instructions>", "", "<${5:block1}>", "$6", "</${5:block1}>" ], "description": "Generate XML prompt block with instructions and block1" }, "XML Tag Snippet Inline": { "prefix": "xxi", "body": [ "<${1:tag}>$2</${1:tag}>", ], "description": "Create an XML tag with a customizable tag name and content" } }