Skip to content

Commit 79332dc

Browse files
Alexey Panfilovclaude
andcommitted
feat: add local role to /routing Telegram UI
All three routing levels (local/primary/reasoner) are now configurable via the /routing inline keyboard in Telegram. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aa66ce0 commit 79332dc

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

internal/telegram/handler.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,16 @@ func routingMenuText(cfg llm.RouterConfig) string {
10791079
}
10801080
return fmt.Sprintf(
10811081
"⚙️ *Routing Configuration*\n\n"+
1082-
"Primary: `%s`\n"+
1082+
"Local \\(1\\): `%s`\n"+
1083+
"Primary \\(2\\): `%s`\n"+
1084+
"Reasoner \\(3\\): `%s`\n"+
10831085
"Fallback: `%s`\n"+
1084-
"Reasoner: `%s`\n"+
10851086
"Classifier: `%s` \\(%s\\)\n"+
10861087
"Multimodal: `%s`",
1088+
escapeMarkdown(cfg.Local),
10871089
escapeMarkdown(cfg.Primary),
1088-
escapeMarkdown(cfg.Fallback),
10891090
escapeMarkdown(cfg.Reasoner),
1091+
escapeMarkdown(cfg.Fallback),
10901092
escapeMarkdown(cfg.Classifier),
10911093
classifierStatus,
10921094
escapeMarkdown(cfg.Multimodal),
@@ -1096,15 +1098,18 @@ func routingMenuText(cfg llm.RouterConfig) string {
10961098
func routingMenuKeyboard(cfg llm.RouterConfig) tgbotapi.InlineKeyboardMarkup {
10971099
return tgbotapi.NewInlineKeyboardMarkup(
10981100
tgbotapi.NewInlineKeyboardRow(
1099-
tgbotapi.NewInlineKeyboardButtonData("✏️ Primary: "+cfg.Primary, "rt:role:primary"),
1101+
tgbotapi.NewInlineKeyboardButtonData("1️⃣ Local: "+cfg.Local, "rt:role:local"),
1102+
tgbotapi.NewInlineKeyboardButtonData("2️⃣ Primary: "+cfg.Primary, "rt:role:primary"),
1103+
),
1104+
tgbotapi.NewInlineKeyboardRow(
1105+
tgbotapi.NewInlineKeyboardButtonData("3️⃣ Reasoner: "+cfg.Reasoner, "rt:role:reasoner"),
11001106
tgbotapi.NewInlineKeyboardButtonData("✏️ Fallback: "+cfg.Fallback, "rt:role:fallback"),
11011107
),
11021108
tgbotapi.NewInlineKeyboardRow(
1103-
tgbotapi.NewInlineKeyboardButtonData("✏️ Reasoner: "+cfg.Reasoner, "rt:role:reasoner"),
11041109
tgbotapi.NewInlineKeyboardButtonData("✏️ Classifier: "+cfg.Classifier, "rt:role:classifier"),
1110+
tgbotapi.NewInlineKeyboardButtonData("✏️ Multimodal: "+cfg.Multimodal, "rt:role:multimodal"),
11051111
),
11061112
tgbotapi.NewInlineKeyboardRow(
1107-
tgbotapi.NewInlineKeyboardButtonData("✏️ Multimodal: "+cfg.Multimodal, "rt:role:multimodal"),
11081113
tgbotapi.NewInlineKeyboardButtonData("✏️ Classifier threshold", "rt:min"),
11091114
),
11101115
)
@@ -1235,6 +1240,7 @@ func (h *Handler) NotifyMissingRouting() {
12351240
}
12361241

12371242
roles := []struct{ name, model string }{
1243+
{"local", cfg.Local},
12381244
{"fallback", cfg.Fallback},
12391245
{"reasoner", cfg.Reasoner},
12401246
{"classifier", cfg.Classifier},
@@ -1258,6 +1264,8 @@ func (h *Handler) NotifyMissingRouting() {
12581264
// roleValue returns the current model name for a given routing role.
12591265
func roleValue(cfg llm.RouterConfig, role string) string {
12601266
switch role {
1267+
case "local":
1268+
return cfg.Local
12611269
case "primary":
12621270
return cfg.Primary
12631271
case "fallback":

0 commit comments

Comments
 (0)