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:
@@ -2,7 +2,6 @@ import * as fs from "fs";
|
||||
import {Environment} from "../common/environment";
|
||||
import {logError} from "../util/utils";
|
||||
import {Answers} from "../model/answers";
|
||||
import path from "node:path";
|
||||
|
||||
type DataJsonFile = {
|
||||
admins: number[]
|
||||
@@ -28,19 +27,6 @@ export async function readData(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function readPrompts(): Promise<void> {
|
||||
try {
|
||||
const prompt = fs.readFileSync(path.join(Environment.DATA_PATH, "system_prompt.txt")).toString().trim();
|
||||
if (prompt.length) {
|
||||
Environment.setSystemPrompt(prompt);
|
||||
}
|
||||
} catch (e) {
|
||||
logError(e);
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
export async function saveData(): Promise<void> {
|
||||
const adminIds: number[] = [];
|
||||
Environment.ADMIN_IDS.forEach(id => adminIds.push(id));
|
||||
|
||||
Reference in New Issue
Block a user