ماذا يحدث في استدعاء API لنموذج لغوي
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
understand what your code sends and receives.
الموضوعات المخطط لها
- An LLM API is an HTTP call: you send a list of messages, you get a reply message back.
- A system message sets the rules and role. User messages carry the request. Earlier assistant messages are context.
- Model parameters such as temperature (randomness) and a maximum output length shape the reply.
- Text is counted in tokens (word pieces). Cost and limits depend on input plus output tokens.
- Output is probabilistic: the same input can give different text, so never assume the format.
تفاصيل المخطط المبدئي
عرض عملي
{ "model": "<configured>",
"messages": [
{"role":"system","content":"You write short product descriptions."},
{"role":"user","content":"Wireless mouse, 2.4 GHz, black"} ],
"max_tokens": 150 }اختبر فهمك
What do you pay for?
أظهر الإجابة
Tokens sent and tokens received.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.