feat: add Ollama audio transcription and runtime config reload

- add audio capability reporting for Ollama models
- support Telegram voice messages via ffmpeg conversion and Ollama transcription
- add USE_SYSTEM_PROMPT toggle and runtime reloading of .env/system prompt settings
- support ollama_options.json for custom Ollama request options
- improve Telegram MarkdownV2 escaping and formatting preservation
- add environment setters for AI provider credentials and models
- show audio capability in info/model commands
This commit is contained in:
2026-05-01 05:09:10 +03:00
parent 382e00ce31
commit 0f91e43ea0
11 changed files with 937 additions and 217 deletions
+3 -5
View File
@@ -20,7 +20,7 @@ import {Ping} from "./commands/ping";
import {RandomString} from "./commands/random-string";
import {SystemInfo} from "./commands/system-info";
import {Test} from "./commands/test";
import {readData, readPrompts, retrieveAnswers} from "./db/database";
import {readData, retrieveAnswers} from "./db/database";
import {Uptime} from "./commands/uptime";
import {WhatBetter} from "./commands/what-better";
import {When} from "./commands/when";
@@ -183,7 +183,7 @@ export const callbackCommands: CallbackCommand[] = [
new YtInfo()
];
if (Environment.OLLAMA_ADDRESS && Environment.OLLAMA_MODEL && Environment.SYSTEM_PROMPT) {
if (Environment.OLLAMA_ADDRESS && Environment.OLLAMA_MODEL) {
commands.push(
new OllamaChat(),
new OllamaPrompt(),
@@ -252,10 +252,8 @@ async function shutdown(signal: NodeJS.Signals) {
async function main() {
const start = Date.now();
await readPrompts();
console.log(Environment.SYSTEM_PROMPT);
console.log(
`TEST_ENVIRONMENT: ${Environment.TEST_ENVIRONMENT}\n` +
`DATA_PATH: ${Environment.DATA_PATH}\n` +