Hi everyone! I am having a problem with transcript...
# agents
l
Hi everyone! I am having a problem with transcriptions and would be incredibly thankful for some help. Every transcription—*including the user’s speech*—comes through with
pInfo.identity
set to the agent’s identity, e.g.
[agent-AJ_3szpKKHndFUd] Hi!
As suggested in the docs, I subscribe to the
lk.transcription
topic in my frontend using the livekit client sdk like so:
Copy code
room.registerTextStreamHandler('lk.transcription', async (reader, pInfo) => {
  for await (const raw of reader) {
    console.log(`[${pInfo.identity}] ${raw}`);
  }
});
I have a barebone agent setup. This is my complete agent:
Copy code
import os, dotenv
from livekit.agents import Agent, AgentSession, AutoSubscribe, JobContext, WorkerOptions, cli, log
from livekit.plugins import azure, openai, silero
logger = log.logger
dotenv.load_dotenv()

async def entrypoint(ctx: JobContext):
    await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
    remote = await ctx.wait_for_participant()
    agent = Agent(instructions="you are an Agent.")
    session = AgentSession(
        vad=silero.VAD.load(),
        stt=azure.STT(
            speech_key=os.environ.get("AZURE_OPENAI_API_KEY"),
            speech_region="swedencentral",
            language="de-DE",
        ),
        llm=openai.LLM.with_azure(
            model="gpt-4o",
            azure_deployment="gpt-4o-data-zone",
            azure_endpoint=os.environ.get("AZURE_OPENAI_ENDPOINT"),
            api_key=os.environ.get("AZURE_OPENAI_API_KEY"),
            api_version="2024-12-01-preview",
        ),
        tts=azure.TTS(
            speech_key=os.environ.get("AZURE_OPENAI_API_KEY"),
            speech_region="swedencentral",
            voice="de-DE-SeraphinaMultilingualNeural",
        ),
        max_tool_steps=10,
    )
    await session.start(agent=agent, room=ctx.room)
    await session.generate_reply(instructions="Say 'Hi!'")

def main():
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, port=os.getenv("AGENT_PORT", 35087)))

if __name__ == "__main__":
    main()
And the deps from my pyproject.toml:
Copy code
[project]
dependencies = [
  "livekit-agents==1.2.8",
  "livekit-plugins-openai==1.2.8",
  "livekit-plugins-aws==1.2.8",
  "livekit-plugins-azure==1.2.8",
  "livekit-plugins-turn-detector==1.2.8",
  "livekit-plugins-silero==1.2.8",
  "pydantic[email]==2.11.9",
  "python-dotenv==1.1.0",
]
requires-python = "~=3.13"
I have python 3.13.4 and my livekit server has version 1.9.1. Does anyone know, where this misbehavior in the transcriptions participant identity comes from? PS: What could be interesting, is that when looking at the
reader.info.attributes
in the frontend, the users transcripts and the agent transcripts have different lk.transcribed_track_id.
j
same for me too. User transcripts come in as agent’s speech leading to other issues. Did you find a solution for this?
l
No, haven't found a solution. Good to know I am not alone with this tho. I raised an issue on github
j
Can you pls share the github link?
Nevermind.. found it.
👍 1
l
you have to downgrade the livekit python sdk to version 1.0.12
j
bad. Losing out of new changes 😞
r
Have you tried 1.2.11?
c
I reported this issue yesterday: https://github.com/livekit/python-sdks/issues/499 pin "livekit" to 1.0.12 version