python-sdks icon indicating copy to clipboard operation
python-sdks copied to clipboard

Problem with retrieving the room name and metadata

Open love4php opened this issue 1 year ago • 1 comments

In the worker, I am trying to obtain the room name and metadata using the following method, but unfortunately, after the latest update, these two values are no longer displayed.

`async def entrypoint(ctx: JobContext): try: print(ctx.room.name) print(ctx.room.metadata)

if name == "main": # Initialize the worker with the entrypoint cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) `

love4php avatar Jul 30 '24 18:07 love4php

I pushed a fix to today to participant metadata: https://github.com/livekit/python-sdks/pull/226 but I'm unable to reproduce your issue for room metadata.

For example, this code:

    lkapi = livekit.api.LiveKitAPI()
    await lkapi.room.update_room_metadata(
        livekit.api.UpdateRoomMetadataRequest(room=ctx.room.name, metadata="test")
    )
    await asyncio.sleep(1)
    print("room md", ctx.room.metadata)

prints "room md test" as expected.

keepingitneil avatar Jul 30 '24 22:07 keepingitneil