This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It sounds like you want to programmatically append a message and have the LLM act on it. Here are the common ways to do that: • To add a message to the agent’s chat history: use
agent.update_chat_ctx(...)
with a
ChatMessage
. This persists the message in the context. Docs • To add user text and immediately trigger a reply: call
session.generate_reply(user_input="...")
. This appends the user message and invokes the LLM. Docs • To inject per-turn context (e.g., your classifier result) before LLM runs: implement
on_user_turn_completed(...)
, modify
new_message
or add extra messages. Persist with
agent.update_chat_ctx(...)
if you want them saved. Docs • From a client, send text on the
lk.chat
text stream; the agent receives and processes it automatically. Docs If you’re using Python, do you want a minimal code snippet for
agent.update_chat_ctx(...)
or
session.generate_reply(...)
? Sources: Agents v0.x migration guide - Python | LiveKit docs | Pipeline nodes and hooks | LiveKit docs | Agents v0.x migration guide - Node.js | LiveKit Docs | Agent speech and audio | LiveKit docs | Sending text | LiveKit docs
b
it is not agent it is not session it is standalone
Copy code
classifier = LLM.with_azure(
    azure_deployment=settings.LLM_MODEL,
    temperature=0.0,
)
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!