You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi livekit team,
I tried to use the event from voice_pipeline_agent @chat.on("message_received") def on_chat_received(msg: rtc.ChatMessage):
I want to interrupt agent speaking when the new message sent to agent. How to achieve this ?
Using following code is not working, It will wait the agent to complete its speech async def answer_from_text(txt: str): # chat_ctx = agent.chat_ctx.copy() agent.chat_ctx.append(role="user", text=txt) stream = agent.llm.chat(chat_ctx=agent.chat_ctx, fnc_ctx=fnc_ctx) logger.info(f"Chat Context Log: ${agent.chat_ctx}") await agent.say(stream, allow_interruptions=True)
Best regards
The text was updated successfully, but these errors were encountered:
Hi livekit team,
I tried to use the event from voice_pipeline_agent
@chat.on("message_received") def on_chat_received(msg: rtc.ChatMessage):
I want to interrupt agent speaking when the new message sent to agent. How to achieve this ?
Using following code is not working, It will wait the agent to complete its speech
async def answer_from_text(txt: str): # chat_ctx = agent.chat_ctx.copy() agent.chat_ctx.append(role="user", text=txt) stream = agent.llm.chat(chat_ctx=agent.chat_ctx, fnc_ctx=fnc_ctx) logger.info(f"Chat Context Log: ${agent.chat_ctx}") await agent.say(stream, allow_interruptions=True)
Best regards
The text was updated successfully, but these errors were encountered: