import type { MsgContext } from "../auto-reply/templating.js"; import type { OpenClawConfig } from "../config/types.js"; import { logVerbose, shouldLogVerbose } from "../globals.js"; import type { ActiveMediaModel } from "./active-model.types.js"; import { isAudioAttachment } from "./attachments.js"; import { runAudioTranscription } from "./audio-transcription-runner.js"; import { normalizeMediaAttachments, resolveMediaAttachmentLocalRoots } from "./runner.js"; import type { MediaUnderstandingProvider } from "./types.js";
/** * Transcribes the first audio attachment BEFORE mention checking. * This allows voice notes to be processed in group chats with requireMention: true. * Returns the transcript or undefined if transcription fails or no audio is found.
*/
export async function transcribeFirstAudio(params: {
ctx: MsgContext;
cfg: OpenClawConfig;
agentDir?: string;
providers?: Record<string, MediaUnderstandingProvider>;
activeModel?: ActiveMediaModel;
}): Promise<string | undefined> { const { ctx, cfg } = params;
// Check if audio transcription is enabled in config const audioConfig = cfg.tools?.media?.audio; if (audioConfig?.enabled === false) { return undefined;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.