ال_
| الاستدعاء | لا شيء | السبب |
|---|---|---|
| عدد المُكْفِيّات | :: 60 | ولم يرد رد لم يصل بعد. |
| models.turn() | )أ( | المنعطف يمكن أن يفكر لوقت طويل قبل أن يجيب |
| assistant.generate() | لا شيء | يمكن أن يأخذ جيل الدقائق؛ انظر أدناه. |
| tools.convert(), tools.fetch() | لا شيء | السبب نفسه. |
| مُنافِي | لا شيء | وقد فتح باب الاتصال عن قصد. |
لماذا لا يوجد موعد نهائي
العمل لا يتوقف لأنك توقفت عن الاستماع: إنه ينتهي، والمكالمة لا تزال مُحررة. لذلك فإن الموعد النهائي للعميل سيكلفك المكالمة ولا يرد شيئا. إربطها بـ Abort Signal بدلا من ذلك، الذي تتحكم به.
وضع وضعك الخاص
// For the whole client
const api = new IaGenify({ apiKey, timeout: 15_000 });
// For one call
await api.models.turn({ model, messages, signal: AbortSignal.timeout(30_000) });# For the whole client, in seconds
api = IaGenify(api_key=api_key, timeout=15)
# For one call
api.models.turn(model=model, messages=messages, timeout=30)أثناء
كل نداء يأخذ signalتم تمرير عملية الإجهاض التي طلبتها في الوقت الحاضر، ولم يتم إعادة تغليفها كفترة زمنية، حتى تستطيع أن تقول إلغاءك الخاص بعيدا عن تخلي العميل.
const controller = new AbortController();
const running = agent.run({
message: "Audit the whole workspace.",
onEvent: console.log,
signal: controller.signal,
});
setTimeout(() => controller.abort(new Error("user cancelled")), 10_000);
try {
await running;
} catch (err) {
if (controller.signal.aborted) console.log("cancelled by us");
else if (err.code === "timeout") console.log("the client gave up");
}import threading
from iagenify import RequestTimeout
# Python has no AbortSignal: stop the agent from another thread
timer = threading.Timer(10, agent.stop)
timer.start()
try:
result = agent.run(message="Audit the whole workspace.", on_event=print)
if result["stopReason"] == "stopped":
print("cancelled by us")
except RequestTimeout:
print("the client gave up")
finally:
timer.cancel()الـ إثنان من الفشل الذي سترونه
| رمز الشفرة | الوضع | المعنى |
|---|---|---|
| ما | 408 | لا يوجد جواب في الموعد النهائي |
| غير قابل لل | 503 | لم يصل الطلب إلى هناك أبداً: القاعدة الخاطئة، لا شبكة، لا شيء يستمع. |
unreachable في الخدمة الموزعة تقريباً الوسائل المستخدمة في جميع الحالات تقريباً baseUrl ليس هو ما قصدته. api.baseUrl « ومقارنتها ب https://api.iagenify.com.