Merge pull request #336 from nulyang/fix/azure-transcriptionframe
services(azure): fix TranscriptionFrame parameter type
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
import asyncio
|
import asyncio
|
||||||
import io
|
import io
|
||||||
import time
|
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from typing import AsyncGenerator
|
from typing import AsyncGenerator
|
||||||
@@ -26,6 +25,7 @@ from pipecat.frames.frames import (
|
|||||||
from pipecat.processors.frame_processor import FrameDirection
|
from pipecat.processors.frame_processor import FrameDirection
|
||||||
from pipecat.services.ai_services import AsyncAIService, TTSService, ImageGenService
|
from pipecat.services.ai_services import AsyncAIService, TTSService, ImageGenService
|
||||||
from pipecat.services.openai import BaseOpenAILLMService
|
from pipecat.services.openai import BaseOpenAILLMService
|
||||||
|
from pipecat.utils.time import time_now_iso8601
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ class AzureSTTService(AsyncAIService):
|
|||||||
|
|
||||||
def _on_handle_recognized(self, event):
|
def _on_handle_recognized(self, event):
|
||||||
if event.result.reason == ResultReason.RecognizedSpeech and len(event.result.text) > 0:
|
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())
|
asyncio.run_coroutine_threadsafe(self.queue_frame(frame), self.get_event_loop())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user