update regex matching - now bot responds only for base commands (like /ping) and with mention (like /ping@panfilovi4_bot) and ignores command if it mentions other bot;

Add ability to see, change and list gemini, mistral and ollama models
This commit is contained in:
2026-01-20 08:31:05 +03:00
parent c31345a3eb
commit 32baaebb93
52 changed files with 605 additions and 231 deletions
+27
View File
@@ -0,0 +1,27 @@
import {ChatCommand} from "../base/chat-command";
import {Message} from "typescript-telegram-bot-api";
import {boolToEmoji, logError, replyToMessage} from "../util/utils";
import {Environment} from "../common/environment";
import {ollama} from "../index";
export class OllamaGetModel extends ChatCommand {
title = "/ollamaGetModel";
description = "Ollama model info";
async execute(msg: Message): Promise<void> {
const showResponse = await ollama.show({model: Environment.OLLAMA_MODEL});
console.log(showResponse);
const caps = showResponse.capabilities;
const text = "```ollama\n" +
`model: ${Environment.OLLAMA_MODEL}\n\n` +
`vision: ${boolToEmoji(caps.includes("vision"))}\n` +
`thinking: ${boolToEmoji(caps.includes("thinking"))}\n` +
`tools: ${boolToEmoji(caps.includes("tools"))}`
+ "```";
await replyToMessage({message: msg, text: text, parse_mode: "Markdown"}).catch(logError);
}
}