Skip to content

Commit d2f1e50

Browse files
committed
fix
1 parent ee44116 commit d2f1e50

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/agent.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
RoomInputOptions,
1111
WorkerOptions,
1212
cli,
13+
inference,
1314
metrics,
1415
)
1516
from livekit.plugins import noise_cancellation, silero
@@ -28,7 +29,7 @@ def __init__(self) -> None:
2829
Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.
2930
You are curious, friendly, and have a sense of humor.""",
3031
)
31-
32+
3233
# To add tools, use the @function_tool decorator.
3334
# Here's an example that adds a simple weather tool.
3435
# You also have to add `from livekit.agents import function_tool, RunContext` to the top of this file
@@ -62,13 +63,15 @@ async def entrypoint(ctx: JobContext):
6263
session = AgentSession(
6364
# Speech-to-text (STT) is your agent's ears, turning the user's speech into text that the LLM can understand
6465
# See all available models at https://docs.livekit.io/agents/models/stt/
65-
stt="assemblyai/universal-streaming:en",
66+
stt=inference.STT(model="assemblyai/universal-streaming", language="en"),
6667
# A Large Language Model (LLM) is your agent's brain, processing user input and generating a response
6768
# See all available models at https://docs.livekit.io/agents/models/llm/
68-
llm="openai/gpt-4.1-mini",
69+
llm=inference.LLM(model="openai/gpt-4.1-mini"),
6970
# Text-to-speech (TTS) is your agent's voice, turning the LLM's text into speech that the user can hear
7071
# See all available models as well as voice selections at https://docs.livekit.io/agents/models/tts/
71-
tts="cartesia/sonic-3:9626c31c-bec5-4cca-baa8-f8ba9e84c8bc",
72+
tts=inference.TTS(
73+
model="cartesia/sonic-3", voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc"
74+
),
7275
# VAD and turn detection are used to determine when the user is speaking and when the agent should respond
7376
# See more at https://docs.livekit.io/agents/build/turns
7477
turn_detection=MultilingualModel(),

0 commit comments

Comments
 (0)