I'm trying to use <https://docs.livekit.io/referen...
# sdk-web
g
I'm trying to use https://docs.livekit.io/reference/components/react/hook/usetranscriptions/ and noticed that I always get the agent participant info no matter who is speaking. I have also tried
Copy code
const handleTranscription = (segments, participant, publication) => {
      console.log('Transcription received:', segments, participant?.identity);
    };

    room.on(RoomEvent.TranscriptionReceived, handleTranscription);
and
Copy code
room.registerTextStreamHandler('lk.transcription',
      async (reader, participantInfo) => {
        const message = await reader.readAll();
        if (reader.info.attributes['lk.transcribed_track_id']) {
          console.log(
            `New transcription from ${participantInfo.identity}: ${message}`);
        } else {
          console.log(
            `New message from ${participantInfo.identity}: ${message}`);
        }
      });
but always get the same identity which seems to suggest that whatever is responsible for setting it is doing it wrong in the backend. android client does not have this issue. any guesses?
r
What version of LiveKit libraries are you using on the agent side?
g
Should be the latest but I can get back to you soon with the exact version
@refined-appointment-81829
Copy code
Requirement already satisfied: livekit in ./.venv/lib/python3.12/site-packages (from -r ./requirements.txt (line 1)) (1.0.13)
Requirement already satisfied: livekit-agents in ./.venv/lib/python3.12/site-packages (from -r ./requirements.txt (line 2)) (1.2.11)
I also noticed @happy-dawn-98083 had the same problem in the #ask-ai channel
also let me know if this is the best place for this info or what's the preferred method for reporting issues like this
r
can you share
pip list |grep livekit
g
Copy code
livekit                                  1.0.13
livekit-agents                           1.2.11
livekit-api                              1.0.5
livekit-blingfire                        1.0.0
livekit-plugins-aws                      1.2.11
livekit-plugins-noise-cancellation       0.2.5
livekit-plugins-openai                   1.2.11
livekit-plugins-silero                   1.2.11
livekit-plugins-turn-detector            1.2.11
livekit-protocol                         1.0.4
r
Let met try and see if I have the issue
g
thanks, appreciate. let me know if you need info on the react js side as well. otherwise if you can't reproduce, let me know what steps you'd like me to take. the agent code is pretty simple if that even plays a part. the react stuff is also simple. it seems to me like a backend issue of some sort given that no matter what I tried I got the wrong participant
r
Seems to work for me.
Copy code
pip list |grep livekit   
livekit                                  1.0.13
livekit-agents                           1.2.11
livekit-api                              1.0.5
livekit-blingfire                        1.0.0
livekit-plugins-assemblyai               1.2.11
livekit-plugins-bey                      1.2.11
livekit-plugins-bithuman                 1.2.11
livekit-plugins-cartesia                 1.2.11
livekit-plugins-deepgram                 1.2.11
livekit-plugins-elevenlabs               1.2.11
livekit-plugins-google                   1.2.11
livekit-plugins-groq                     1.2.11
livekit-plugins-noise-cancellation       0.2.5
livekit-plugins-openai                   1.2.11
livekit-plugins-rime                     1.2.11
livekit-plugins-silero                   1.2.11
livekit-plugins-speechmatics             1.2.11
livekit-plugins-tavus                    1.2.11
livekit-plugins-turn-detector            1.2.11
livekit-protocol                         1.0.6
g
ok, and the playground uses the react components?
r
Copy code
cat requirements.txt 

livekit-plugins-noise-cancellation
livekit-agents[google,openai,silero,deepgram,cartesia,elevenlabs,turn-detector,bey,tavus,bithuman,rime,speechmatics,groq,assemblyai]~=1.2
yes
g
what is responsible for setting the participant?
r
Let me check
g
could explicit dispatch have anything to do with it? I get the correct ID from room if I query it, but for transcriptions it exclusively has the agent even for users atm
explicit dispatch won't cause any difference but I can try it easily
g
useTrackTranscription
looks like it's using that internally. assuming it has some difference in implementation compared to
useTranscriptions
?
r
Looks like our
livekit-protocol
are different. Try upgrading to
1.0.6
👍 1
g
upgraded it but no difference so far
image.png
Message 3 was me, message 4 is the response from the agent
Copy code
const { chatMessages, send, isSending } = useChat(chatOptions);

  const transcriptions = useTranscriptions();

  const transcriptionMessages = React.useMemo(() =>
    transcriptions.map((transcription) => ({
      id: transcription.streamInfo.id,
      timestamp: transcription.streamInfo.timestamp,
      message: transcription.text,
      from: room.getParticipantByIdentity(
        transcription.participantInfo.identity),
    })), [transcriptions, room]
  );

  console.log('Transcription messages created:', transcriptionMessages);
  const allMessages = React.useMemo(() => {
    const combined = [...chatMessages, ...transcriptionMessages];
    return combined.sort((a, b) => a.timestamp - b.timestamp);
  }, [chatMessages, transcriptionMessages]);
yeah, the playground makes use of the deprecated function it seems
useTrackTranscription
Should I open a Github issue @refined-appointment-81829?
g
@great-oil-61627 Did you ever get this issue resolved? I'm experiencing the same problem.
g
Nope. Still happening
r
We have identified the issue and are working on a fix in the Rust SDK
👍 2
🙌 1
g
Will a fix be needed for other SDKs as well?
g
^ I am currently using the JS SDK.
r
yes, once Rust is updated a new python SDK etc will be released
👍 1
I believe changes have been made already and is now being tested
🙌 1
g
@refined-appointment-81829 Is the SDK release scheduled to go out soon to fix this?
r
I believe so. I see a PR was just created for it.
🙌 1
g
Excellent. Thank you!