Skip to content

Commit bd9fd59

Browse files
committed
Fixes
1 parent a45def5 commit bd9fd59

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A complete starter project for building voice AI apps with [LiveKit Agents for P
99
The starter project includes:
1010

1111
- A simple voice AI assistant, ready for extension and customization
12-
- A voice AI pipeline with [models](https://docs.livekit.io/agents/models) from OpenAI, Cartesia, and Deepgram served through LiveKit Cloud
12+
- A voice AI pipeline with [models](https://docs.livekit.io/agents/models) from OpenAI, Cartesia, and AssemblyAI served through LiveKit Cloud
1313
- Easily integrate your preferred [LLM](https://docs.livekit.io/agents/models/llm/), [STT](https://docs.livekit.io/agents/models/stt/), and [TTS](https://docs.livekit.io/agents/models/tts/) instead, or swap to a realtime model like the [OpenAI Realtime API](https://docs.livekit.io/agents/models/realtime/openai)
1414
- Eval suite based on the LiveKit Agents [testing & evaluation framework](https://docs.livekit.io/agents/build/testing/)
1515
- [LiveKit Turn Detector](https://docs.livekit.io/agents/build/turns/turn-detector/) for contextually-aware speaker detection, with multilingual support

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "Simple voice AI assistant built with LiveKit Agents for Python"
99
requires-python = ">=3.9"
1010

1111
dependencies = [
12-
"livekit-agents[turn-detector,silero]~=1.2",
12+
"livekit-agents[silero,turn-detector]~=1.2",
1313
"livekit-plugins-noise-cancellation~=0.2",
1414
"python-dotenv",
1515
]

src/agent.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
from dotenv import load_dotenv
44
from livekit.agents import (
5-
NOT_GIVEN,
65
Agent,
7-
AgentFalseInterruptionEvent,
86
AgentSession,
97
JobContext,
108
JobProcess,
119
MetricsCollectedEvent,
1210
RoomInputOptions,
1311
WorkerOptions,
1412
cli,
15-
inference,
1613
metrics,
1714
)
1815
from livekit.plugins import noise_cancellation, silero
@@ -61,14 +58,14 @@ async def entrypoint(ctx: JobContext):
6158
"room": ctx.room.name,
6259
}
6360

64-
# Set up a voice AI pipeline using OpenAI, Cartesia, Deepgram, and the LiveKit turn detector
61+
# Set up a voice AI pipeline using OpenAI, Cartesia, AssemblyAI, and the LiveKit turn detector
6562
session = AgentSession(
63+
# Speech-to-text (STT) is your agent's ears, turning the user's speech into text that the LLM can understand
64+
# See all available models at https://docs.livekit.io/agents/models/stt/
65+
stt="assemblyai/universal-streaming",
6666
# A Large Language Model (LLM) is your agent's brain, processing user input and generating a response
6767
# See all available models at https://docs.livekit.io/agents/models/llm/
6868
llm="azure/gpt-4o-mini",
69-
# Speech-to-text (STT) is your agent's ears, turning the user's speech into text that the LLM can understand
70-
# See all available models at https://docs.livekit.io/agents/models/stt/
71-
stt=inference.STT(language="multi"),
7269
# Text-to-speech (TTS) is your agent's voice, turning the LLM's text into speech that the user can hear
7370
# See all available models as well as voice selections at https://docs.livekit.io/agents/models/tts/
7471
tts="cartesia/sonic-2:f786b574-daa5-4673-aa0c-cbe3e8534c02",
@@ -91,13 +88,6 @@ async def entrypoint(ctx: JobContext):
9188
# llm=openai.realtime.RealtimeModel(voice="marin")
9289
# )
9390

94-
# sometimes background noise could interrupt the agent session, these are considered false positive interruptions
95-
# when it's detected, you may resume the agent's speech
96-
@session.on("agent_false_interruption")
97-
def _on_agent_false_interruption(ev: AgentFalseInterruptionEvent):
98-
logger.info("false positive interruption, resuming")
99-
session.generate_reply(instructions=ev.extra_instructions or NOT_GIVEN)
100-
10191
# Metrics collection, to measure pipeline performance
10292
# For more information, see https://docs.livekit.io/agents/build/metrics/
10393
usage_collector = metrics.UsageCollector()

0 commit comments

Comments
 (0)