arisa 4.1.4 → 4.1.6
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/package.json +1 -1
- package/src/runtime/bootstrap.js +17 -1
package/package.json
CHANGED
package/src/runtime/bootstrap.js
CHANGED
|
@@ -331,8 +331,10 @@ async function runTelegramBootstrap({ telegramApiKey, setupToken, botInfo }) {
|
|
|
331
331
|
const askModel = async (ctx = null, page = 0) => {
|
|
332
332
|
state = "model";
|
|
333
333
|
const models = sortBootstrapModels(selectedProvider.provider, listProviderModels(selectedProvider.provider, createPiRuntime()));
|
|
334
|
+
const keyboard = buildPagedInlineKeyboard("model", models.map((model) => ({ text: formatModelOption(model) })), { page });
|
|
335
|
+
keyboard.inline_keyboard.push([{ text: "Back to providers", callback_data: "back:provider" }]);
|
|
334
336
|
await showSetupPrompt(ctx, `Select the model for ${selectedProvider.provider}:`, {
|
|
335
|
-
reply_markup:
|
|
337
|
+
reply_markup: keyboard
|
|
336
338
|
});
|
|
337
339
|
};
|
|
338
340
|
|
|
@@ -368,6 +370,7 @@ async function runTelegramBootstrap({ telegramApiKey, setupToken, botInfo }) {
|
|
|
368
370
|
buttons.push([{ text: selectedAuthReady ? "Run Pi login again" : "Start Pi login", callback_data: "auth:login" }]);
|
|
369
371
|
}
|
|
370
372
|
buttons.push([{ text: "Enter API key", callback_data: "auth:key" }]);
|
|
373
|
+
buttons.push([{ text: "Back to models", callback_data: "back:model" }]);
|
|
371
374
|
|
|
372
375
|
state = "auth-method";
|
|
373
376
|
await showSetupPrompt(ctx, [
|
|
@@ -470,6 +473,19 @@ async function runTelegramBootstrap({ telegramApiKey, setupToken, botInfo }) {
|
|
|
470
473
|
|
|
471
474
|
if (action === "noop") return;
|
|
472
475
|
|
|
476
|
+
if (action === "back" && rawValue === "provider" && state === "model") {
|
|
477
|
+
selectedProvider = null;
|
|
478
|
+
selectedModel = null;
|
|
479
|
+
await askProvider(ctx);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (action === "back" && rawValue === "model" && state === "auth-method") {
|
|
484
|
+
selectedModel = null;
|
|
485
|
+
await askModel(ctx);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
473
489
|
if (action === "provider-page" && state === "provider") {
|
|
474
490
|
await askProvider(ctx, Number(rawValue));
|
|
475
491
|
return;
|