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
+8 -1
View File
@@ -65,8 +65,10 @@ export class OllamaGetModel extends Command {
private getModelText(model: string, info: AiModelCapabilities): string {
return `model: ${model}\n\n` +
`vision: ${boolToEmoji(info.vision?.supported)}\n` +
`ocr: ${boolToEmoji(info.ocr?.supported)}\n` +
`thinking: ${boolToEmoji(info.thinking?.supported)}\n` +
`tools: ${boolToEmoji(info.tools?.supported)}`;
`tools: ${boolToEmoji(info.tools?.supported)}\n` +
`audio: ${boolToEmoji(info.audio?.supported)}`;
}
async getModelCapabilities(model: string = Environment.OLLAMA_MODEL): Promise<AiModelCapabilities | null> {
@@ -95,6 +97,11 @@ export class OllamaGetModel extends Command {
external: model !== Environment.OLLAMA_MODEL,
model: model
},
audio: {
supported: info.capabilities.includes("audio"),
external: model !== Environment.OLLAMA_MODEL,
model: model
}
};
} catch (e) {
logError(e);