what is the issue here : ``` [13:30:5] ╚══════════...
# ask-ai
h
what is the issue here :
Copy code
[13:30:5] ╚════════════════════════════════════════════════════════════════════╝
[13:30:5] 💬 User said: 'to do is, is it possible that I can follow-up through it?'
2025-12-16 13:30:55,977 - ERROR livekit.agents - error occured during on_user_turn_completed 
Traceback (most recent call last):
  File "/Users/deepeshagrawal/adventure/beerGuys/teleOne/venv/lib/python3.12/site-packages/livekit/agents/voice/agent_activity.py", line 1357, in _user_turn_completed_task
    await self._agent.on_user_turn_completed(
  File "/Users/deepeshagrawal/adventure/beerGuys/teleOne/main.py", line 96, in on_user_turn_completed
    fast_ctx = llm.ChatContext(messages=fast_messages)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ChatContext.__init__() got an unexpected keyword argument 'messages'
[Audio] OnePlus Nord Buds 2r [-104.14 dBFS] [------------------------------]
t
Thanks for reaching out, Deepesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing a TypeError because
llm.ChatContext
does not accept a
messages
keyword in its constructor. You're passing
messages=fast_messages
, which causes: TypeError: ChatContext.*init*() got an unexpected keyword argument 'messages' What to do instead: 1. Create an empty
ChatContext
. 2. Add each message with
add_message()
. Example:
Copy code
fast_ctx = llm.ChatContext()
for m in fast_messages:
    fast_ctx.add_message(role=m["role"], content=m["content"])
If your messages are in a different shape, tell me the structure (example element) and I’ll show the exact loop. Would you like me to convert a sample of your
fast_messages
for you? Sources: Agents v0.x migration guide - Python | LiveKit docs | External data and RAG | LiveKit Docs