File "/home/mayur/.local/lib/python3.10/site-packa...
# ask-ai
l
File "/home/mayur/.local/lib/python3.10/site-packages/livekit/plugins/openai/beta/assistant_llm.py", line 26, in <module> from livekit.agents.llm import LLMCapabilities, ToolChoice ImportError: cannot import name 'LLMCapabilities' from 'livekit.agents.llm' (/home/mayur/.local/lib/python3.10/site-packages/livekit/agents/llm/__init__.py)
t
Thanks for reaching out, Mayur. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you share a bit more about the LiveKit version you're using and any recent changes or updates you've made to your setup? That info will really help us figure out what's going on with the 'LLMCapabilities' import error.
l
"livekit-agents[cartesia,deepgram,openai,silero,turn-detector]~=1.2", "livekit-plugins-noise-cancellation~=0.2",
t
The
LLMCapabilities
class isn’t part of the
livekit.agents.llm
module in LiveKit version 1.2. But no worries! You can use the
RealtimeCapabilities
class from
livekit.agents.llm.realtime
to set up features like
message_truncation
,
turn_detection
, and
audio_output
. Here’s a quick example to get you started:
Copy code
from livekit.agents.llm.realtime import RealtimeCapabilities

caps = RealtimeCapabilities(
    message_truncation=True,
    turn_detection=True,
    audio_output=True,
)
Just double-check that your code isn’t using any old or incorrect class names. If you thought
LLMCapabilities
should be there, it might have been renamed or removed in earlier versions. Feel free to reach out if you want me to help you with anything else! Sources: Ollama integration guide | LiveKit Docs | Baseten LLM integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/llm.py | OpenAI LLM integration guide | LiveKit Docs