diff --git a/apps/livekit/app.py b/apps/livekit/app.py index 40ae4fa16..ee4d23119 100644 --- a/apps/livekit/app.py +++ b/apps/livekit/app.py @@ -1,11 +1,19 @@ import asyncio import os + from livekit.agents import JobContext, JobRequest, WorkerOptions, cli from loguru import logger from pydantic_settings import BaseSettings, SettingsConfigDict from vocode.logging import configure_pretty_logging +from vocode.streaming.action.end_conversation import EndConversationVocodeActionConfig from vocode.streaming.agent.chat_gpt_agent import ChatGPTAgent +from vocode.streaming.livekit.livekit_conversation import LiveKitConversation +from vocode.streaming.models.actions import ( + PhraseBasedActionTrigger, + PhraseBasedActionTriggerConfig, + PhraseTrigger, +) from vocode.streaming.models.agent import ChatGPTAgentConfig from vocode.streaming.models.audio import AudioEncoding from vocode.streaming.models.message import BaseMessage @@ -17,13 +25,6 @@ from vocode.streaming.output_device.livekit_output_device import LiveKitOutputDevice from vocode.streaming.synthesizer.eleven_labs_synthesizer import ElevenLabsSynthesizer from vocode.streaming.transcriber.deepgram_transcriber import DeepgramTranscriber -from vocode.streaming.livekit.livekit_conversation import LiveKitConversation -from vocode.streaming.action.end_conversation import EndConversationVocodeActionConfig -from vocode.streaming.models.actions import ( - PhraseBasedActionTrigger, - PhraseBasedActionTriggerConfig, - PhraseTrigger, -) class Settings(BaseSettings): diff --git a/vocode/streaming/livekit/livekit_conversation.py b/vocode/streaming/livekit/livekit_conversation.py index 37282e3e0..9818b7056 100644 --- a/vocode/streaming/livekit/livekit_conversation.py +++ b/vocode/streaming/livekit/livekit_conversation.py @@ -1,10 +1,11 @@ import asyncio +from livekit import rtc from loguru import logger + from vocode.streaming.livekit.livekit_events_manager import LiveKitEventsManager -from vocode.streaming.streaming_conversation import StreamingConversation from vocode.streaming.output_device.livekit_output_device import LiveKitOutputDevice -from livekit import rtc +from vocode.streaming.streaming_conversation import StreamingConversation class LiveKitConversation(StreamingConversation[LiveKitOutputDevice]): diff --git a/vocode/streaming/livekit/livekit_events_manager.py b/vocode/streaming/livekit/livekit_events_manager.py index 9d904a0a5..5daaefcc8 100644 --- a/vocode/streaming/livekit/livekit_events_manager.py +++ b/vocode/streaming/livekit/livekit_events_manager.py @@ -1,9 +1,11 @@ -from typing import TYPE_CHECKING, List import uuid +from typing import TYPE_CHECKING, List + +from livekit import rtc + from vocode.streaming.models.events import Event, EventType, Sender from vocode.streaming.models.transcript import TranscriptEvent from vocode.streaming.utils.events_manager import EventsManager -from livekit import rtc if TYPE_CHECKING: from vocode.streaming.livekit.livekit_conversation import LiveKitConversation diff --git a/vocode/streaming/output_device/livekit_output_device.py b/vocode/streaming/output_device/livekit_output_device.py index 3debb447a..cb8e13ab8 100644 --- a/vocode/streaming/output_device/livekit_output_device.py +++ b/vocode/streaming/output_device/livekit_output_device.py @@ -1,7 +1,9 @@ import asyncio + +from livekit import rtc + from vocode.streaming.models.audio import AudioEncoding from vocode.streaming.output_device.abstract_output_device import AbstractOutputDevice -from livekit import rtc from vocode.streaming.output_device.audio_chunk import ChunkState NUM_CHANNELS = 1