Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Nov 14, 2023
1 parent 41793b4 commit 9368bb2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ $ pip install livekit-api
from livekit import api
import os

token = api.AccessToken(os.getenv('LIVEKIT_API_KEY'), os.getenv('LIVEKIT_API_SECRET')) \
# will automatically use the LIVEKIT_API_KEY and LIVEKIT_API_SECRET env vars
token = api.AccessToken() \
.with_identity("python-bot") \
.with_name("Python Bot") \
.with_grants(api.VideoGrants(
Expand All @@ -51,18 +52,16 @@ from livekit import api
import asyncio

async def main():
room_service = api.RoomService(
lkapi = api.LiveKitAPI(
'http://localhost:7880',
'devkey',
'secret',
)
room_info = await room_service.create_room(
api.room.CreateRoomRequest(name="my-room"),
room_info = await lkapi.room.create_room(
api.CreateRoomRequest(name="my-room"),
)
print(room_info)
results = await room_service.list_rooms(api.room.ListRoomsRequest())
results = await lkapi.room.list_rooms(api.room.ListRoomsRequest())
print(results)
await room_service.aclose()
await lkapi.aclose()

asyncio.get_event_loop().run_until_complete(main())
```
Expand Down

0 comments on commit 9368bb2

Please sign in to comment.