Merge pull request #336 from nulyang/fix/azure-transcriptionframe

services(azure): fix TranscriptionFrame parameter type
This commit is contained in:
Aleix Conchillo Flaqué
2024-08-15 17:08:56 -07:00
committed by GitHub

View File

@@ -7,7 +7,6 @@
import aiohttp
import asyncio
import io
import time
from PIL import Image
from typing import AsyncGenerator
@@ -26,6 +25,7 @@ from pipecat.frames.frames import (
from pipecat.processors.frame_processor import FrameDirection
from pipecat.services.ai_services import AsyncAIService, TTSService, ImageGenService
from pipecat.services.openai import BaseOpenAILLMService
from pipecat.utils.time import time_now_iso8601
from loguru import logger
@@ -164,7 +164,7 @@ class AzureSTTService(AsyncAIService):
def _on_handle_recognized(self, event):
if event.result.reason == ResultReason.RecognizedSpeech and len(event.result.text) > 0:
frame = TranscriptionFrame(event.result.text, "", int(time.time_ns() / 1000000))
frame = TranscriptionFrame(event.result.text, "", time_now_iso8601())
asyncio.run_coroutine_threadsafe(self.queue_frame(frame), self.get_event_loop())