Guides / Prompt Engineering

Prompt Engineering

Systematic techniques for getting consistent, high-quality outputs from LLMs — in Turkish and multilingual contexts.

12 min read

Structure your prompt

Use a consistent format: System → Context → Task → Format. For Turkish, explicitly set language in the system prompt to avoid code-switching.

Sistem: Sen Türkçe konuşan bir müşteri destek asistanısın.
Yalnızca Türkçe yanıt ver.
Görev: {görev}
Format: JSON

Few-shot examples

3–5 high-quality examples in the prompt outperform zero-shot for classification and extraction. Match examples to your exact output format.

Chain-of-thought for reasoning

Add "Let's think step by step" or "Adım adım düşünelim" before complex tasks. This alone can improve accuracy by 20–40% on Turkish reasoning tasks.

Temperature & sampling

Use temp=0 for extraction/classification, temp=0.7 for creative tasks. Avoid top_p<0.9 on Turkish — it truncates the long-tail vocabulary.

Guardrails & output validation

Parse model output with Zod/Pydantic. Never trust raw LLM output in production. Retry with a corrective prompt on parse failure.