Official best practices for prompting Meta's Llama models, including Llama 3 and Code Llama
View Official DocumentationList some programming languages
List 5 programming languages suitable for beginners. Format: Numbered list For each language include: - Name - One sentence on why it's beginner-friendly - One popular use case
Explicit formatting instructions ensure consistent, structured output.
You are a senior Python developer conducting a code review.
Rules:
- Focus on code quality and best practices
- Be constructive, not harsh
- Suggest specific improvements
- Prioritize security issues
Review this code:
```python
def get_user(id):
return db.query(f"SELECT * FROM users WHERE id = {id}")
```The role sets expertise level while rules constrain the review style and focus.
Convert informal text to professional email language. Example: Input: "hey can u send me that report asap thx" Output: "Hello, could you please send me the report at your earliest convenience? Thank you." Now convert: Input: "gonna need those numbers before the meeting tmrw"
The example establishes both the task and the desired tone transformation.
Think through this problem step by step: A store has a 20% off sale. If an item originally costs $80 and you have a $10 coupon that applies after the discount, how much do you pay? Show your reasoning, then give the final answer.
Explicit step-by-step instruction improves accuracy on math and logic problems.
Use ONLY the following information to answer the question. If the answer is not in the provided text, say "I don't have enough information."
<retrieved_documents>
{Insert relevant documents here}
</retrieved_documents>
Question: {User's question}Constraining to retrieved documents reduces hallucination in knowledge-intensive tasks.