@ax-llm/ax 10.0.44 → 10.0.45
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/index.cjs +10 -7
- package/index.cjs.map +1 -1
- package/index.js +10 -7
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1178,10 +1178,10 @@ var GoogleVertexAuth = class {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
const client = await this.getAuthenticatedClient();
|
|
1180
1180
|
const tokenResponse = await client.getAccessToken();
|
|
1181
|
-
this.currentToken = tokenResponse.token
|
|
1181
|
+
this.currentToken = tokenResponse.token;
|
|
1182
1182
|
const expiry = this.getExpiry(tokenResponse);
|
|
1183
|
-
const
|
|
1184
|
-
this.tokenExpiry = expiry -
|
|
1183
|
+
const tenMinutes = 10 * 60 * 1e3;
|
|
1184
|
+
this.tokenExpiry = expiry - tenMinutes;
|
|
1185
1185
|
return this.currentToken;
|
|
1186
1186
|
}
|
|
1187
1187
|
/**
|
|
@@ -1201,8 +1201,6 @@ var GoogleVertexAuth = class {
|
|
|
1201
1201
|
} else {
|
|
1202
1202
|
console.warn("Unknown expiry type", responseExpiry);
|
|
1203
1203
|
}
|
|
1204
|
-
} else {
|
|
1205
|
-
console.warn("No expiry date found in response", tokenResponse.res?.data);
|
|
1206
1204
|
}
|
|
1207
1205
|
return expiry;
|
|
1208
1206
|
}
|
|
@@ -6185,11 +6183,16 @@ var AxBalancer = class _AxBalancer {
|
|
|
6185
6183
|
default:
|
|
6186
6184
|
throw e;
|
|
6187
6185
|
}
|
|
6188
|
-
console.warn(
|
|
6186
|
+
console.warn(
|
|
6187
|
+
`AxBalancer: Service ${this.currentService.getName()} failed`,
|
|
6188
|
+
e
|
|
6189
|
+
);
|
|
6189
6190
|
if (!this.getNextService()) {
|
|
6190
6191
|
throw e;
|
|
6191
6192
|
}
|
|
6192
|
-
console.warn(
|
|
6193
|
+
console.warn(
|
|
6194
|
+
`AxBalancer: Switching to service ${this.currentService.getName()}`
|
|
6195
|
+
);
|
|
6193
6196
|
}
|
|
6194
6197
|
}
|
|
6195
6198
|
}
|