promptimizer-cli 0.1.43 → 0.1.44
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/bin/promptimizer.mjs +8 -8
- package/package.json +1 -1
package/bin/promptimizer.mjs
CHANGED
|
@@ -51,7 +51,6 @@ const COMMAND_HELP = {
|
|
|
51
51
|
"Usage",
|
|
52
52
|
" promptimizer connect <provider> --key <vendor-key>",
|
|
53
53
|
" promptimizer connect custom --base-url <url> --key <vendor-key>",
|
|
54
|
-
" promptimizer connect simulator",
|
|
55
54
|
"",
|
|
56
55
|
"Adds a host to your fleet without replacing others.",
|
|
57
56
|
"Aliases: add",
|
|
@@ -451,9 +450,12 @@ async function cmdConnect(flags, positional) {
|
|
|
451
450
|
}
|
|
452
451
|
|
|
453
452
|
const mock = provider === "simulator" || provider === "mock";
|
|
453
|
+
if (mock) {
|
|
454
|
+
die("Simulator mode was removed. Connect a real provider, e.g. promptimizer connect baseten --key …");
|
|
455
|
+
}
|
|
454
456
|
let vendorKey = flags.key || flags.k;
|
|
455
457
|
let label = flags.label;
|
|
456
|
-
if (!
|
|
458
|
+
if (!baseURL && provider && provider !== "custom") {
|
|
457
459
|
const catalog = await request("/v1/providers", { gatewayURL });
|
|
458
460
|
const found = (catalog.data ?? []).find(
|
|
459
461
|
(row) => row.id === provider || String(row.label).toLowerCase() === provider.toLowerCase(),
|
|
@@ -464,7 +466,7 @@ async function cmdConnect(flags, positional) {
|
|
|
464
466
|
die(`Missing API key for ${found.label}. Pass --key or set ${found.env}.`);
|
|
465
467
|
}
|
|
466
468
|
label = label || found.label;
|
|
467
|
-
} else if (!
|
|
469
|
+
} else if (!vendorKey && provider !== "ollama") {
|
|
468
470
|
die("Missing provider key. Pass --key.");
|
|
469
471
|
}
|
|
470
472
|
|
|
@@ -473,9 +475,7 @@ async function cmdConnect(flags, positional) {
|
|
|
473
475
|
method: "POST",
|
|
474
476
|
gatewayURL,
|
|
475
477
|
apiKey,
|
|
476
|
-
body:
|
|
477
|
-
? { mode: "mock", label: "Promptimizer simulator" }
|
|
478
|
-
: {
|
|
478
|
+
body: {
|
|
479
479
|
mode: "byok",
|
|
480
480
|
label,
|
|
481
481
|
provider: provider && provider !== "custom" ? provider : undefined,
|
|
@@ -519,8 +519,8 @@ async function cmdHosts(flags) {
|
|
|
519
519
|
const connections = session.connections ?? [];
|
|
520
520
|
out();
|
|
521
521
|
if (!connections.length) {
|
|
522
|
-
out(` ${
|
|
523
|
-
out(` ${
|
|
522
|
+
out(` ${color(ANSI.dim, "No hosts connected.")}`);
|
|
523
|
+
out(` ${color(ANSI.dim, "Add: promptimizer connect <host> --key …")}`);
|
|
524
524
|
out();
|
|
525
525
|
return session;
|
|
526
526
|
}
|