@adaptic/utils 0.0.1017 → 0.0.1018
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.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/llm/alias-client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -65293,7 +65293,16 @@ function gatewayFor(chain) {
|
|
|
65293
65293
|
gatewayTransport = createGatewayTransport({
|
|
65294
65294
|
baseUrl,
|
|
65295
65295
|
apiKeyEnv: config.gatewayApiKeyEnv ?? DEFAULT_GATEWAY_KEY_ENV,
|
|
65296
|
-
|
|
65296
|
+
// The chain is re-resolved from the request's own route rather than
|
|
65297
|
+
// captured from the caller above. The transport is cached for the life of
|
|
65298
|
+
// the process, so a captured chain would bind every later alias to
|
|
65299
|
+
// whichever alias happened to dispatch first: its head leg would never
|
|
65300
|
+
// match, would be addressed as "<alias>.fallback.primary" — a name the
|
|
65301
|
+
// gateway does not register — and the 400 would be absorbed by the
|
|
65302
|
+
// fallback chain. The call still succeeds, from the SECONDARY leg, which
|
|
65303
|
+
// is why this reads as healthy traffic while every alias but one quietly
|
|
65304
|
+
// stops using the model it was chosen for.
|
|
65305
|
+
modelNameFor: (request) => gatewayModelNameFor(request.route, resolveChain(request.route.alias, { isolated: request.route.isolated })),
|
|
65297
65306
|
});
|
|
65298
65307
|
}
|
|
65299
65308
|
return gatewayTransport;
|
|
@@ -65381,7 +65390,7 @@ async function callLLMByAlias(content, responseFormat = "text", options) {
|
|
|
65381
65390
|
cost: 0,
|
|
65382
65391
|
});
|
|
65383
65392
|
}
|
|
65384
|
-
const gateway = gatewayFor(
|
|
65393
|
+
const gateway = gatewayFor();
|
|
65385
65394
|
const attemptLog = [];
|
|
65386
65395
|
/**
|
|
65387
65396
|
* Run the chain, falling back from the gateway to the degraded direct path
|