Prompt Engineering
Definisi
Prompt engineering adalah seni dan ilmu merancang input (prompt) untuk LLM agar menghasilkan output optimal.
Teknik
- Zero-shot — langsung tanya
- Few-shot — beri beberapa contoh
- Chain-of-Thought (CoT) — minta AI berpikir step-by-step
- Tree-of-Thoughts (ToT) — CoT dengan branching
- ReAct — reasoning + acting (tool use)
- Role prompting — “You are a senior engineer…”
- Structured output — JSON / Pydantic
- System prompts — instruksi global
Tools
- LangChain, LlamaIndex — framework
- Guidance, DSPy — programmatic prompting
- BAML, Instructor — structured output
- Promptfoo — testing