Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed agent_dispatch.py typos #319

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/agent_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"""


async def create_explicit_disptach(http_session: aiohttp.ClientSession):
agent_disptach_service = AgentDispatchService(
async def create_explicit_dispatch(http_session: aiohttp.ClientSession):
agent_dispatch_service = AgentDispatchService(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-hamdananwar, could you update this example to use api.LiveKitAPI() as seen on our docs (also fixing the imports to import protobuf types from livekit.api instead of livekit.protocol.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidzhao I have added it in this PR #322

session=http_session,
url=os.getenv("LIVEKIT_URL"),
api_key=os.getenv("LIVEKIT_API_KEY"),
Expand All @@ -32,9 +32,9 @@ async def create_explicit_disptach(http_session: aiohttp.ClientSession):
dispatch_request = CreateAgentDispatchRequest(
agent_name=agent_name, room=room_name, metadata="my_metadata"
)
dispatch = await agent_disptach_service.create_dispatch(dispatch_request)
dispatch = await agent_dispatch_service.create_dispatch(dispatch_request)
print("created dispatch", dispatch)
dispatches = await agent_disptach_service.list_dispatch(room_name=room_name)
dispatches = await agent_dispatch_service.list_dispatch(room_name=room_name)
print(f"there are {len(dispatches)} dispatches in {room_name}")


Expand Down Expand Up @@ -68,7 +68,7 @@ async def main():
token = await create_token_with_agent_dispatch()
print("created participant token", token)
print("creating explicit dispatch")
await create_explicit_disptach(http_session)
await create_explicit_dispatch(http_session)


asyncio.run(main())
Loading