ReadonlycodeWhy the call failed: "RATE_LIMITED", "PROVIDER_ERROR", "CIRCUIT_OPEN" or "TIMEOUT".
ReadonlyretryHow long the provider asked the caller to wait before trying again, in milliseconds, or null when it did not say.
ReadonlystatusThe HTTP status the provider answered with, or null when the failure happened before any answer arrived (a timeout, a connection failure, an open breaker).
Thrown by
B.ai.callandAiAgent.sendMessagewhen the provider could not be reached or answered with an error, after the retry policy gave up.codesays which;statusandretryAfterMillisare present when the provider supplied them. A refusal, a token cap or an iteration cap is not an exception: those return a result whoseoutcomesays what happened.Example: ```javascript try { const result = B.ai.call({ message: B.net.request.parameter("q") }); B.out = result.text; } catch (e) { if (e.code === "RATE_LIMITED" && e.retryAfterMillis) { B.out = "Busy — try again in " + Math.ceil(e.retryAfterMillis / 1000) + "s."; } else if (e.code === "CIRCUIT_OPEN") { B.out = "The model is unreachable right now."; } else { throw e; } } ```