Skip to content

Commit 6f9a968

Browse files
committed
comment
1 parent 41bf843 commit 6f9a968

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/agent.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ def __init__(self) -> None:
2929
# A Large Language Model (LLM) is your agent's brain, processing user input and generating a response
3030
# See all available models at https://docs.livekit.io/agents/models/llm/
3131
llm=inference.LLM(model="openai/gpt-5.2-chat-latest"),
32+
33+
# To use a realtime model instead of a voice pipeline, replace the LLM
34+
# with a RealtimeModel and remove the STT/TTS from the AgentSession
35+
# (Note: This is for the OpenAI Realtime API. For other providers, see https://docs.livekit.io/agents/models/realtime/)
36+
# 1. Install livekit-agents[openai]
37+
# 2. Set OPENAI_API_KEY in .env.local
38+
# 3. Add `from livekit.plugins import openai` to the top of this file
39+
# 4. Replace the llm argument with:
40+
# llm=openai.realtime.RealtimeModel(voice="marin")
3241
)
3342

3443
# To add tools, use the @function_tool decorator.
@@ -77,6 +86,7 @@ async def my_agent(ctx: JobContext):
7786
tts=inference.TTS(
7887
model="cartesia/sonic-3", voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc"
7988
),
89+
8090
# VAD and turn detection are used to determine when the user is speaking and when the agent should respond
8191
# See more at https://docs.livekit.io/agents/build/turns
8292
turn_detection=MultilingualModel(),
@@ -86,15 +96,6 @@ async def my_agent(ctx: JobContext):
8696
preemptive_generation=True,
8797
)
8898

89-
# To use a realtime model instead of a voice pipeline, replace the LLM on Assistant
90-
# with a RealtimeModel and remove the STT/TTS from this session.
91-
# (Note: This is for the OpenAI Realtime API. For other providers, see https://docs.livekit.io/agents/models/realtime/))
92-
# 1. Install livekit-agents[openai]
93-
# 2. Set OPENAI_API_KEY in .env.local
94-
# 3. Add `from livekit.plugins import openai` to the top of this file
95-
# 4. In Assistant, replace the llm argument with:
96-
# llm=openai.realtime.RealtimeModel(voice="marin")
97-
9899
# # Add a virtual avatar to the session, if desired
99100
# # For other providers, see https://docs.livekit.io/agents/models/avatar/
100101
# avatar = hedra.AvatarSession(

0 commit comments

Comments
 (0)