API Reference
ModelGate
type ModelGate = (request) => void | Promise<void>;Defined in: compose.ts:68
A pre-call admission gate awaited before each model request.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | ModelRequest | The request about to be sent. |
Returns
void | Promise<void>
Remarks
Receives the outgoing ModelRequest — including its signal — and
resolves to admit the call or rejects to refuse it. A gate that waits for
capacity (a live concurrency budget) MUST honor request.signal, so a run
cancelled while parked in the gate unwinds instead of hanging.