نضجت هندسة الأوامر (Prompt Engineering) من فنّ إلى علم. ستساعدك هذه التقنيات المُختبَرة في الإنتاج على بناء ميزات ذكاء اصطناعي موثوقة.
التقنيات الأساسية
1. أوامر النظام (System Prompts)
const systemPrompt = `You are a customer support agent for TechCo.
Rules:
- Only answer questions about TechCo products
- Never reveal pricing without verification
- Escalate complex issues to human agents
- Always be polite and professional`;
2. التعلّم بأمثلة قليلة (Few-Shot)
const prompt = `Classify the sentiment of customer reviews.
Review: "Great product, fast delivery!"
Sentiment: Positive
Review: "Item arrived damaged, very disappointed."
Sentiment: Negative
Review: "${userReview}"
Sentiment:`;
3. سلسلة التفكير (Chain-of-Thought)
const prompt = `Solve this step by step:
Question: ${question}
Think through the problem:
1. First, identify what we know
2. Then, determine what we need to find
3. Apply relevant formulas or logic
4. Calculate the final answer
Solution:`;
أنماط الإنتاج
- استخدم مخرجات منظّمة (وضع JSON)
- طبّق منطق إعادة المحاولة مع التراجع التدريجي (backoff)
- أضف تحققاً من المدخلات والمخرجات
- راقب استهلاك الرموز (tokens) والتكاليف
- اختبر تنويعات الأوامر عبر اختبار A/B
التعليقات (0)
اترك تعليقًا
لا توجد تعليقات بعد. كن أول من يشارك أفكاره!