kubeagent 0.1.22 → 0.1.23
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/cli.js +23 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -452,10 +452,29 @@ program
|
|
|
452
452
|
process.exit(1);
|
|
453
453
|
}
|
|
454
454
|
const { proxyRequest } = await import("./proxy-client.js");
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
455
|
+
let result;
|
|
456
|
+
try {
|
|
457
|
+
result = await proxyRequest(auth, {
|
|
458
|
+
max_tokens: 16000,
|
|
459
|
+
messages: [{ role: "user", content: prompt.join(" ") }],
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
catch (err) {
|
|
463
|
+
const e = err;
|
|
464
|
+
if (e.status === 429) {
|
|
465
|
+
console.error(chalk.red("Token balance exhausted.") + " " + chalk.dim("Run: kubeagent account") + " to check your balance, then upgrade at " + chalk.cyan("https://app.kubeagent.net"));
|
|
466
|
+
}
|
|
467
|
+
else if (e.status === 401) {
|
|
468
|
+
console.error(chalk.red("Not authenticated.") + " " + chalk.dim("Run: kubeagent login"));
|
|
469
|
+
}
|
|
470
|
+
else if (e.status === 400) {
|
|
471
|
+
console.error(chalk.red("Bad request: ") + chalk.dim(e.message.replace("KubeAgent proxy: ", "")));
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
console.error(chalk.red("Error: ") + e.message.replace("KubeAgent proxy: ", ""));
|
|
475
|
+
}
|
|
476
|
+
process.exit(1);
|
|
477
|
+
}
|
|
459
478
|
const response = result;
|
|
460
479
|
for (const block of response.content) {
|
|
461
480
|
if (block.type === "text") {
|