শেষ token-এর জন্য অপেক্ষা করবেন না।
সেট করুন stream: true করুন যাতে server-sent events পাওয়া যায়। প্রতিটি event-এর data: payload-এ completion chunk থাকে। stream শেষ হয় data: [DONE].
data: {"choices":[{"delta":{"content":"Hello"}}]}
data: {"choices":[{"delta":{"content":" there."}}]}
data: [DONE]এটি প্রোটোকলের উদাহরণমাত্র, বাস্তব API উত্তর বা ব্যবহার রেকর্ড নয়।
বিচ্ছিন্নতা স্পষ্টভাবে সামলান
আংশিক stream স্বয়ংক্রিয়ভাবে আবার চালাবেন না। সংযোগ বিচ্ছিন্ন মানেই মডেল তৈরি বন্ধ করেছে এমন নয়। বিলযোগ্য কাজ পুনরায় করার আগে অনুরোধ লগ ও trace ID দেখুন।
curl https://unlimit.chat/v1/chat/completions \
-H "Authorization: Bearer $UNLIMIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [
{"role": "user", "content": "What if we built something different?"}
],
"stream": true
}'