@lasso-ai/cli 2.1.2 → 2.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/cli/project.js +25 -1
- package/package.json +1 -1
package/dist/cli/project.js
CHANGED
|
@@ -394,8 +394,32 @@ async function resolveWorkspaceConfig(fileEnv) {
|
|
|
394
394
|
async function fetchModels(fileEnv) {
|
|
395
395
|
const serverUrl = (0, auth_1.serverUrlFrom)(fileEnv).replace(/\/$/, "");
|
|
396
396
|
const apiUrl = `${serverUrl}/api/v1`;
|
|
397
|
+
// Pass the user's own provider keys (BYOK) so the server can list live
|
|
398
|
+
// models per provider instead of falling back to empty/static lists.
|
|
399
|
+
const envKey = (...names) => {
|
|
400
|
+
for (const name of names) {
|
|
401
|
+
const value = (process.env[name] || fileEnv[name] || "").trim();
|
|
402
|
+
if (value)
|
|
403
|
+
return value;
|
|
404
|
+
}
|
|
405
|
+
return "";
|
|
406
|
+
};
|
|
407
|
+
const query = new URLSearchParams();
|
|
408
|
+
const anthropicKey = envKey("ANTHROPIC_API_KEY");
|
|
409
|
+
const openaiKey = envKey("OPENAI_API_KEY");
|
|
410
|
+
const googleKey = envKey("GOOGLE_GENERATIVE_AI_API_KEY", "GOOGLE_API_KEY");
|
|
411
|
+
const nvidiaKey = envKey("NVIDIA_API_KEY");
|
|
412
|
+
if (anthropicKey)
|
|
413
|
+
query.set("anthropicKey", anthropicKey);
|
|
414
|
+
if (openaiKey)
|
|
415
|
+
query.set("openaiKey", openaiKey);
|
|
416
|
+
if (googleKey)
|
|
417
|
+
query.set("googleKey", googleKey);
|
|
418
|
+
if (nvidiaKey)
|
|
419
|
+
query.set("nvidiaKey", nvidiaKey);
|
|
420
|
+
const qs = query.toString();
|
|
397
421
|
try {
|
|
398
|
-
const response = await (0, auth_1.fetchWithTimeout)(`${apiUrl}/models`, {
|
|
422
|
+
const response = await (0, auth_1.fetchWithTimeout)(`${apiUrl}/models${qs ? `?${qs}` : ""}`, {
|
|
399
423
|
method: "GET",
|
|
400
424
|
});
|
|
401
425
|
if (!response.ok) {
|
package/package.json
CHANGED