Skip to content

Instantly share code, notes, and snippets.

@patrickstorm
Created June 7, 2024 19:01
Show Gist options
  • Save patrickstorm/378d5bc6940da3cfca90eecaa86871e5 to your computer and use it in GitHub Desktop.
Save patrickstorm/378d5bc6940da3cfca90eecaa86871e5 to your computer and use it in GitHub Desktop.
Perfect Prompt Template
# Persona #
Act as a...
[Here is where you add the expert role that the LLM will take on. Include adjectives like compassionate or deep thinker here as well.]
# Task #
Your task is...
[This is where you clearly define the task you want the LLM to complete. Be as specific and clear as possible.]
# Context #
[Here you add any context that the LLM would need to complete the task. Ask yourself, "What info would I need to know to complete this task?" And lastly, try not to include any context that is not necessary for the task as it may confuse the LLM.]
# Response #
Please respond with...
[Here you add the format of the response you want the LLM to give. This could be a paragraph, a list, a table, etc.]
# Examples #
[Optionally, include examples of the responses you are looking for. You may include example input/output combos, or just example responses. This is usually only needed for ocmplex tasks]
[Bonus: If the task involves a lot of reasoning, it is usually helpful to add "Let's think step by step" here.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment