voice scripts :
# ask-ai
m
voice scripts :
t
Thanks for reaching out, aigentzi. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help with voice scripts. Which kind do you need? Please tell me: • The use case (IVR, customer support, sales, drive‑through, chatbot, onboarding, etc.) • Desired tone/length (formal vs casual, short prompts vs full dialogs) • Any required steps or data collection (account number, order details, verification questions) • If you want TTS/STT behavior or specific AI prompt instructions included I can then draft sample voice scripts and suggested prompt engineering/output formatting for your agent. Would you like short examples first or a full call flow? Sources: LiveKit Docs | Prompting guide | LiveKit docs
m
can you gice clear instructions to ourt AI builder that we are susinga nexenive list of providers , but alwasy using Livekit inference api not our own provider keys
t
You're asking for clear instructions to give your AI builder so it can use many provider models but always route through the LiveKit Inference API (not your own provider keys). Below are concise, copy‑able instructions and an example you can give your AI builder team. Acknowledgement: This addresses ensuring model selection uses LiveKit Inference and never instantiates provider plugins with customer-owned keys. Core rule • Always pass model identifiers as strings to the agent/session config (e.g.,
"openai/gpt-4.1-mini"
,
"elevenlabs/aura-1:Rachel"
,
"deepgram/nova-2"
). Do not instantiate provider plugin classes or include provider API keys in your code. What to do (step‑by‑step) 1. Configure your agent/session with model strings for STT, LLM, and TTS: ◦ Example:
Copy code
from livekit.agents import AgentSession

     session = AgentSession(
         stt="deepgram/nova-2",
         llm="openai/gpt-4.1-mini",
         tts="elevenlabs/aura-1:Rachel",
     )
1. Ensure only your LiveKit API key is used for authentication when calling LiveKit endpoints. Do not store or use provider-specific API keys in the builder or runtime. 2. Do NOT instantiate provider plugin classes (these require your provider keys). Avoid code like:
Copy code
from livekit.plugins import openai, elevenlabs

   # ❌ Avoid this — uses customer provider keys
   llm = openai.LLM(model="gpt-4.1-mini")
   tts = elevenlabs.TTS(voice="Rachel")
1. When you need to change providers or try different models, switch the model string only (no key changes). Example alternatives: ◦ LLMs:
"google/gemini-2.5-flash"
,
"openai/gpt-4.1-mini"
◦ STT:
"assemblyai/..."
,
"deepgram/nova-2"
◦ TTS:
"elevenlabs/aura-1:Rachel"
,
"cartesia/..."
How to validate you’re using LiveKit Inference • Confirm usage and billing appear in the LiveKit dashboard and on LiveKit invoices (not separate provider invoices). • Confirm code contains model strings and no provider key files or plugin instantiations. Short checklist to share with your builder team • [ ] Use model strings in
AgentSession
(STT/LLM/TTS) • [ ] Only use the LiveKit API key for auth • [ ] Remove any provider API keys from code/config • [ ] Do not instantiate provider plugin classes • [ ] Test switching providers by changing model strings only If you want, I can: • Draft a short policy snippet or README entry your builders can add to the repo. • Provide additional code examples for Node/Python or CI checks to enforce no provider keys in the repo. Which would you prefer? Sources: Models | LiveKit Docs | Speech-to-text (STT) models | LiveKit Docs | Large language models (LLM) | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docs | Introducing LiveKit Inference: A unified model interface for voice AI
m
cabn yus hare code on how to coinfigureaccesnts with open ai and genmini live relatime voices eg NY accent etc etc
t
Acknowledging: You want code examples to configure real‑time voices with OpenAI and Google Gemini (Gemini Live) and guidance on getting a specific accent (e.g., New York). Quick clarifying questions so I give the right code: 1. Which language do you want examples in — Python or Node.js? 2. Do you need full AgentSession examples (STT+LLM+TTS) or only realtime TTS setup? 3. Do you want runtime prompt‑style accent instructions (LLM prompt) or only provider voice selection/SSML where supported? What I can provide next (pick one): • Short Python example showing LiveKit AgentSession using OpenAI realtime voice + notes about accent limits. • Short Node.js example showing Gemini Live realtime voice + SSML/prompt suggestions. • A repo README snippet and CI check to ensure no provider keys are used (LiveKit inference only). Reply with your choices for 1–3 and I’ll return the matching code and practical tips. Sources: OpenAI Realtime API plugin guide | LiveKit docs | Gemini Live API plugin | LiveKit docs | Agent speech and audio | LiveKit docs | Hume TTS plugin guide | LiveKit Docs
m
python , i am refeing t the accenst of teh voices i belive it can be defined ?
t
Acknowledging: you asked for Python code to configure OpenAI and Gemini realtime voices in LiveKit and whether accents (e.g., New York) can be defined. Short answer: you cannot set an explicit
accent
parameter. Use voice selection + prompt/instructions to influence style, and SSML (with Google Cloud TTS) for finer phonetic control. Below are concise Python examples and practical tips. 1) OpenAI Realtime voice (LiveKit)
Copy code
from livekit.plugins import openai
from livekit.agents import AgentSession

session = AgentSession(
    llm=openai.realtime.RealtimeModel(
        voice="ash",            # choose a predefined voice name
        temperature=0.6,
        modalities=["audio", "text"],
    ),
)
# Use LLM instructions to nudge style:
# e.g., include in agent instructions: "Speak with a brisk, direct New York style."
2) Google Gemini Live voice (LiveKit) — use
instructions
to influence delivery
Copy code
from livekit.plugins import google
from livekit.agents import AgentSession

session = AgentSession(
    llm=google.realtime.RealtimeModel(
        model="gemini-2.0-flash",
        voice="Puck",           # choose a Gemini voice
        temperature=0.7,
        instructions="Speak confidently with a quick, direct East Coast delivery (subtle NY-style cadence).",
    ),
)
3) If you need more precise accent/pronunciation control — Google Cloud TTS + SSML (not realtime Gemini)
Copy code
from livekit.plugins import google
from livekit.agents import AgentSession

session = AgentSession(
    tts=google.TTS(
        language="en-US",
        voice_name="en-US-Wavenet-D",  # pick a US voice with desired character
    )
)

# Use SSML when sending text to synthesize:
ssml = """
<speak>
  <prosody rate="fast" pitch="+0st">
    Hello — this is an example phrasing with a brisk, streetwise New York delivery.
  </prosody>
</speak>
"""
# send ssml as the TTS input where supported
Practical tips • Choose voices that naturally sound closer to the target accent; voice names imply styles but do not map 1:1 to regional accents. • Use
instructions
(Gemini) or agent prompt engineering to request a NY accent or other regional traits—this often yields reasonable approximations. • Use SSML (Google Cloud TTS) for phonetic and prosody tweaks for finer control; SSML is not guaranteed in realtime Gemini/OpenAI. • Test multiple voice names and instruction wordings; accents are approximated by voice model + prompt, not a dedicated
accent
parameter. If you want, I can: • Produce a short agent instruction template that prompts for a New York accent. • Give a Node.js equivalent or a test script to compare voices side-by-side. Which would you prefer? Sources: Google Cloud TTS integration guide | LiveKit Docs