text_only example not working
It seems that the text_only example does not work correctly. To reproduce, run an agent, connect to it via the sandbox, and attempt to chat with the agent over text. The user's messages are registered but the assistant messages do not show up.
which frontend are you using?
most likely it's because the agent transcription is not shown up in the playground when there is no audio track published, we will fix that in the frontend soon. But for now you should be able to see the agent output from lk.transcription text stream topic (https://docs.livekit.io/agents/build/text/), or here is an example that joins the room and listen to the transcriptions.
fixed in #2490
Hey @davidzhao and @longcw thank you for taking a look at this! The fix made in #2490 was indeed a problem, but it seems that Playground requires some changes as well to support this usecase. Specifically, in text-only mode, I needed to merge in the lk.chat and lk.transcriptions topic into one message history (using the new useTranscriptions hook in livekit/components js 2.9.9). Interestingly, I tried using useChat with the lk.transcriptions topic, but it seems there may be a bug with registering to multiple topics possibly associated with this line.
Eventually I'd like to support voice and audio but as a first version we are using livekit agent exclusively with text, so I have a feeling later this may be a problem if I want to support both usecases, but for now this solution will work for me.
I have a similar setup where I'm trying to implement text-only functionality using audio_enabled=False as specified on the docs https://docs.livekit.io/agents/build/text/.
I'm expecting the agent to publish text responses to the lk.transcription text stream topic. But when I tried to listen to the streams, I saw that the agent text responses are sent in lk.chat topic.
@longcw @davidzhao Any idea why? Or am I doing something wrong.
@sid-js which livekit-agents version are you using, can you share the result of pip list | grep livekit? Only in a few old preview version it was sent to lk.chat topic, but after that it should always use the lk.transcription topic. And you can also test it with the this example by join the same room of the agent.
Here are the versions that I'm using @longcw
livekit 1.0.8
livekit-agents 1.0.23
livekit-api 1.0.2
livekit-plugins-deepgram 1.0.23
livekit-plugins-google 1.0.23
livekit-plugins-noise-cancellation 0.2.4
livekit-plugins-openai 1.0.23
livekit-plugins-silero 1.0.23
livekit-plugins-turn-detector 1.0.23
livekit-protocol 1.0.3
I've tried the example to listen to the messages in the room, here is the logs:
Listening for chat messages. Press Ctrl+C to exit...
[agent-AJ_yMrUwiZW7WqV][chat][SG_458f9c42b5f8][new]: Nice to meet you! How can I assist you with your business today? [final=true]
[agent-AJ_yMrUwiZW7WqV][chat][SG_9ab6545fc381][new]: Of course, Please tell me more about what you need help with, and I'll do my best to assist you. [final=true]
@sid-js from the logs the agent responses are there as expected.
@longcw But aren't they sent in the chat topic instead of transcriptions topic?
@sid-js the example is reading from transcription topic https://github.com/livekit/agents/blob/main/examples/other/chat-stream-receiver.py#L168 and we expect the agent transcription sent to that.
@longcw Why would a text only agent output to lk.transcription and not lk.chat?