worried-petabyte-38885
06/06/2025, 7:37 PMtall-airline-16756
06/06/2025, 7:38 PMtall-airline-16756
06/06/2025, 7:39 PMfrom livekit.agents import JobContext, llm, AgentSession
from livekit.plugins import (
cartesia,
deepgram,
google,
silero,
)
async def entrypoint(ctx: JobContext):
# Replace chat_ctx=initial_ctx with system prompt in AgentSession
agent = AgentSession(
vad=silero.VAD.load(),
stt=deepgram.STT(),
llm=google.LLM(),
tts=cartesia.TTS(),
system_prompt="You are a helpful voice AI assistant.", # Replaces chat_ctx=initial_ctx
# allow_interruptions=True is likely still supported but not explicitly shown in migration example
)
await agent.start(room, participant)
await agent.say("Hey, how can I help you today?", allow_interruptions=True)
For the callbacks: - before_llm_cb is replaced with llm_node - before_tts_cb is replaced with tts_node These nodes provide more flexibility for customizing the pipeline behavior. Let me know if you need further assistance! Sources: Agents 0.x migration guide | LiveKit Docsworried-petabyte-38885
06/06/2025, 7:41 PMcontent items, which can contain text, images, or audio.
• `FunctionCall`: a function call initiated by the LLM.
• `FunctionCallOutput`: the result returned from a function call.
Updating chat context
In 0.x, updating the chat context required modifying chat_ctx.messages directly. This approach was error-prone and difficult to time correctly, especially with realtime APIs.
In v1.0, there are two supported ways to update the chat context:
• Agent handoff – transferring control to a new agent, which will have its own chat context.
• Explicit update - calling agent.update_chat_ctx() to modify the context directly.
Transcriptions
Agents 1.0 brings some new changes to how transcriptions are handled:
• Transcriptions now use text streams with topic lk.transcription.
• The old transcription protocol is deprecated and will be removed in v1.1.
• for now both protocols are used for backwards compatibility.
• Upcoming versions SDKs/components standardize on text streams for transcriptions.
Accepting text input
Agents 1.0 introduces improved support for text input. Previously, text had to be manually intercepted and injected into the agent via ChatManager.
In this version, agents automatically receive text input from a text stream on the lk.chat topic.
The ChatManager has been removed in Python SDK v1.0.tall-airline-16756
06/06/2025, 7:41 PMworried-petabyte-38885
06/06/2025, 8:06 PM