المهلات وإعادة المحاولة وميزانيات الرموز (Tokens)
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
keep model calls from hurting your service or your bill.
الموضوعات المخطط لها
- Model calls are slow and can fail. Set a connect and read timeout.
- Retry only transient failures (timeouts,
429,5xx), a small number of times, with a growing delay. - Set a max output tokens limit per request and limit input size too; this is your token budget.
- Cap user-provided text length before it reaches the prompt.
- Log token usage so cost can be watched; do not log secrets or private data.
تفاصيل المخطط المبدئي
عرض عملي
# property names: verify for the chosen provider
app.ai.timeout: 10s
app.ai.max-tokens: 300اختبر فهمك
Which failures deserve a retry?
أظهر الإجابة
Transient ones: timeouts, 429, 5xx.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.