@xelauvas/xela-cli 0.1.3 → 0.1.4
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/xela.js +9 -2
- package/package.json +1 -1
package/bin/xela.js
CHANGED
|
@@ -103,10 +103,17 @@ async function setup() {
|
|
|
103
103
|
const tag = m === providerInfo.default ? ' (default)' : '';
|
|
104
104
|
console.log(` ${i + 1}. ${m}${tag}`);
|
|
105
105
|
});
|
|
106
|
+
console.log(` ${models.length + 1}. custom (type any model ID)`);
|
|
106
107
|
console.log('');
|
|
107
108
|
const modelChoice = await ask(' Pick a model [1]: ');
|
|
108
|
-
const
|
|
109
|
-
|
|
109
|
+
const modelNum = parseInt(modelChoice) || 1;
|
|
110
|
+
let model;
|
|
111
|
+
if (modelNum > models.length) {
|
|
112
|
+
model = await ask(' Model ID: ');
|
|
113
|
+
if (!model) model = providerInfo.default;
|
|
114
|
+
} else {
|
|
115
|
+
model = models[Math.min(modelNum - 1, models.length - 1)];
|
|
116
|
+
}
|
|
110
117
|
|
|
111
118
|
mkdirSync(XELA_HOME, { recursive: true });
|
|
112
119
|
const config = { provider, apiKey, model, baseUrl: '' };
|