Quiz 2

Prompt Engineering

71 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Prompt Engineering ## Techniques Technique Description Example Zero-shot No examples, just instruction "Classify this review as positive or negative" Few-shot Provide 2-5 examples Show 3 examples before asking Chain-of-thought Step-by-step reasoning "Let's think step by step" Role prompting Assign persona "You are...

Prompt Engineering

Techniques

TechniqueDescriptionExample
Zero-shotNo examples, just instruction"Classify this review as positive or negative"
Few-shotProvide 2-5 examplesShow 3 examples before asking
Chain-of-thoughtStep-by-step reasoning"Let's think step by step"
Role promptingAssign persona"You are an expert mathematician"
python
# Example using OpenAI API
import openai
response = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful tutor."},
        {"role": "user", "content": "Explain gradient descent."}
    ]
)
print(response.choices[0].message.content)
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.