bitter-appointment-81509
10/31/2025, 3:00 PMtall-airline-16756
10/31/2025, 3:00 PMtall-airline-16756
10/31/2025, 3:00 PMprompt parameter during initialization. This gets sent as part of the initial configuration message over the WebSocket connection.
• AWS Bedrock's Sonic Realtime Model: Here, you can use the system_content parameter in the create_prompt_start_block method to set the system prompt right at the start of your session.
• VoicePipelineAgent: A great approach is to append to the llm.ChatContext() to set an initial conversation context. Plus, you can use session.say() if you want the agent to speak a predefined message or generate_reply() if you’d like more control over the response.
These options give you the flexibility to guide your agent’s behavior and set the context right from the beginning, making your sessions smoother and more tailored to your needs.
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | delay-handling/agent.py | Agent speech and audio | LiveKit docsbitter-appointment-81509
10/31/2025, 3:01 PMtall-airline-16756
10/31/2025, 3:01 PMprompt parameter in the openai.STT class. Here’s a quick example:
from livekit.plugins import openai
stt = openai.STT(
model="whisper-1",
prompt="Transcribe technical terms accurately, such as 'API', 'LLM', and 'real-time'.",
language="en",
detect_language=False,
)
This helps guide the transcription right from the start.
• For Large Language Models (LLM): You can use llm.ChatContext to add a system message, or the instructions parameter if you’re working with Azure OpenAI. For example:
from livekit.agents import llm
initial_ctx = llm.ChatContext().append(
role="system",
text="You are a voice assistant created by LiveKit. Keep responses short and concise, suitable for voice playback.",
)
agent = VoicePipelineAgent(
llm=openai.LLM(),
chat_ctx=initial_ctx,
)
These approaches gently set the stage for the AI, making sure it understands the context before handling the very first user request. If you have any questions or want me to walk you through it further, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py | meditation_assistant/README.mdoc | Azure OpenAI Realtime API and LiveKit | LiveKit Docsbitter-appointment-81509
10/31/2025, 3:11 PMtall-airline-16756
10/31/2025, 3:11 PMinstructions parameter when creating your agent. Think of this as the system prompt that gently guides your agent's behavior. Here's a simple example to get you started:
const agent = new voice.Agent({
instructions: 'You are a helpful assistant. Speak clearly and concisely.',
});
These instructions help define your agent’s personality and how it interacts during conversations.
What’s even better is that you can update these instructions on the fly during a session with the updateInstructions method. Here’s a little snippet to illustrate that:
class ChangeInstructionsAgent(Agent):
def __init__(self):
super().__init__(
instructions="You are a helpful agent. When the user speaks, you listen and respond.",
)
async def on_enter(self):
if self.session.participant.name.startswith("sip"):
self.update_instructions("You are a helpful agent speaking on the phone.")
self.session.generate_reply()
This flexibility lets your agent adapt its behavior based on who it's talking to or what's happening in the session. If you'd like, I’m here to walk you through more examples or answer any questions you might have—just let me know!
Sources: plugins/openai/src/realtime/realtime_model.ts | docs/index.yaml | examples/voice_agents/raw_function_description.py | agent/main.py | src/agent.tsbitter-appointment-81509
10/31/2025, 3:12 PMtall-airline-16756
10/31/2025, 3:13 PMinstructions parameter in the agent does send the prompt right before the very first request. It’s included as part of a session.update event during the session initialization, which means the instructions are taken into account before any user interaction begins.
This works the same way across OpenAI, Azure OpenAI, and other supported realtime models in LiveKit. Think of the instructions as a helpful guide that sets the tone for the agent’s behavior right from the start of your session.
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py | plugins/openai/src/realtime/realtime_model.ts | Azure OpenAI Realtime API and LiveKit | LiveKit Docs | OpenAI TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit docsbitter-appointment-81509
10/31/2025, 3:17 PMtall-airline-16756
10/31/2025, 3:17 PMinstructions parameter is there to help set the system prompt right at the start of your session. So, it’s sent either just before or at the very beginning of your first request, making sure those instructions are included in the initial context for the agent’s responses.
If you’re noticing something different or unexpected, please don’t hesitate to let me know. I’m here to help you troubleshoot or clarify any details to make sure everything works smoothly for you.
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | Azure OpenAI Realtime API and LiveKit | LiveKit Docs