@xelauvas/xela-cli 0.1.3 → 0.1.5
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/src/utils/model/model.ts +5 -0
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: '' };
|
package/package.json
CHANGED
package/src/utils/model/model.ts
CHANGED
|
@@ -192,6 +192,11 @@ export function getRuntimeMainLoopModel(params: {
|
|
|
192
192
|
* @returns The default model setting to use
|
|
193
193
|
*/
|
|
194
194
|
export function getDefaultMainLoopModelSetting(): ModelName | ModelAlias {
|
|
195
|
+
// OpenAI-compatible backend: use OPENAI_MODEL
|
|
196
|
+
if (process.env.OPENAI_API_KEY) {
|
|
197
|
+
return process.env.OPENAI_MODEL || 'gpt-4o'
|
|
198
|
+
}
|
|
199
|
+
|
|
195
200
|
// Ants default to defaultModel from flag config, or Opus 1M if not configured
|
|
196
201
|
if (process.env.USER_TYPE === 'ant') {
|
|
197
202
|
return (
|