@cortexkit/anthropic-auth-core 2.16.2 → 2.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30303,22 +30303,23 @@ class StickySessionRouter {
|
|
|
30303
30303
|
} while (pending !== this.publicationChain);
|
|
30304
30304
|
}
|
|
30305
30305
|
selectCandidate(input) {
|
|
30306
|
-
|
|
30307
|
-
|
|
30308
|
-
|
|
30309
|
-
if (depleted.length > 0)
|
|
30310
|
-
candidates = depleted;
|
|
30311
|
-
}
|
|
30312
|
-
const weighted = candidates.flatMap((candidate) => {
|
|
30306
|
+
const { candidates } = input;
|
|
30307
|
+
const now = this.now();
|
|
30308
|
+
let weighted = candidates.flatMap((candidate) => {
|
|
30313
30309
|
const weight = stickyRouteCandidateWeight({
|
|
30314
30310
|
candidate,
|
|
30315
30311
|
family: input.family,
|
|
30316
30312
|
modelId: input.modelId,
|
|
30317
30313
|
storage: input.storage,
|
|
30318
|
-
now
|
|
30314
|
+
now
|
|
30319
30315
|
});
|
|
30320
30316
|
return weight > 0 ? [{ candidate, weight }] : [];
|
|
30321
30317
|
});
|
|
30318
|
+
if (input.family === "opus") {
|
|
30319
|
+
const depleted = weighted.filter(({ candidate }) => stickyRouteKnownFableExhausted(candidate, input.storage, now));
|
|
30320
|
+
if (depleted.length > 0)
|
|
30321
|
+
weighted = depleted;
|
|
30322
|
+
}
|
|
30322
30323
|
if (weighted.length === 0 && candidates.every((candidate) => !knownQuota(candidate.quota))) {
|
|
30323
30324
|
return [...candidates].sort((left, right) => left.order - right.order || left.accountId.localeCompare(right.accountId))[0];
|
|
30324
30325
|
}
|