feat: add telegram bot

This commit is contained in:
2025-05-09 19:05:23 +02:00
parent d450f4ed42
commit acefbcbd14
6 changed files with 148 additions and 1 deletions

View File

@@ -228,3 +228,21 @@ export async function extractRecipe(content: string) {
return recipeResponseSchema.parse(completion.choices[0].message.parsed);
}
export async function transcribe(
mp3Data: Uint8Array,
): Promise<string | undefined> {
if (!openAI) return;
const file = new File([mp3Data], "audio.mp3", {
type: "audio/mpeg",
});
const result = await openAI.audio.transcriptions.create({
file,
model: "whisper-1",
response_format: "text",
});
return result;
}