@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
22 lines (21 loc) • 683 B
JavaScript
/**
* Context-specific error classes for budget and overflow scenarios.
*/
/**
* Thrown when context exceeds model budget after all compaction stages,
* preventing wasteful API calls to providers that will reject the request.
*/
export class ContextBudgetExceededError extends Error {
estimatedTokens;
availableTokens;
stagesUsed;
breakdown;
constructor(message, details) {
super(message);
this.name = "ContextBudgetExceededError";
this.estimatedTokens = details.estimatedTokens;
this.availableTokens = details.availableTokens;
this.stagesUsed = details.stagesUsed;
this.breakdown = details.breakdown;
}
}