@space3-npm/cybersoul-client 1.1.2 → 1.1.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/client.js +8 -3
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -10,7 +10,7 @@ export class CyberSoulClient {
|
|
|
10
10
|
maxRetries;
|
|
11
11
|
constructor(config) {
|
|
12
12
|
this.config = config;
|
|
13
|
-
this.requestTimeoutMs = config.requestTimeoutMs ??
|
|
13
|
+
this.requestTimeoutMs = config.requestTimeoutMs ?? 120000;
|
|
14
14
|
this.maxRetries = Math.max(0, config.maxRetries ?? 1);
|
|
15
15
|
// Setup Provider
|
|
16
16
|
if (config.llmConfig.provider === "minimax") {
|
|
@@ -50,9 +50,14 @@ export class CyberSoulClient {
|
|
|
50
50
|
return response;
|
|
51
51
|
}
|
|
52
52
|
catch (error) {
|
|
53
|
-
|
|
53
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
54
|
+
lastError = new Error(`Request timed out after ${this.requestTimeoutMs}ms: ${method} ${endpoint}`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
lastError = error;
|
|
58
|
+
}
|
|
54
59
|
if (attempt >= retryLimit) {
|
|
55
|
-
throw
|
|
60
|
+
throw lastError;
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
finally {
|