SakibAhmed commited on
Commit
bf4595d
·
verified ·
1 Parent(s): d417d5b

Upload server.py

Browse files
Files changed (1) hide show
  1. server.py +4 -5
server.py CHANGED
@@ -45,8 +45,8 @@ def get_token():
45
  api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
46
  .with_identity(identity)
47
  .with_name(f"Visitor-{identity}")
48
- # CORRECTED: .with_grant() changed to .with_grants()
49
- .with_grants(api.VideoGrant(room_join=True, room=ROOM_NAME))
50
  )
51
 
52
  return flask.jsonify({"token": token.to_jwt()})
@@ -64,8 +64,8 @@ def run_agent_worker():
64
  api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
65
  .with_identity("devraze-agent")
66
  .with_name("DevRaze")
67
- # CORRECTED: .with_grant() changed to .with_grants()
68
- .with_grants(api.VideoGrant(room_join=True, room=ROOM_NAME, room_admin=True, hidden=True))
69
  )
70
 
71
  # The `livekit-agent` CLI is the standard way to run agent workers
@@ -99,5 +99,4 @@ if __name__ == "__main__":
99
  agent_thread.start()
100
 
101
  # Run the Flask app for the frontend and token generation
102
- # CORRECTED: Port changed to 7860 for Hugging Face Spaces
103
  app.run(host="0.0.0.0", port=7860)
 
45
  api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
46
  .with_identity(identity)
47
  .with_name(f"Visitor-{identity}")
48
+ # CORRECTED: api.VideoGrant changed to api.VideoGrants
49
+ .with_grants(api.VideoGrants(room_join=True, room=ROOM_NAME))
50
  )
51
 
52
  return flask.jsonify({"token": token.to_jwt()})
 
64
  api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
65
  .with_identity("devraze-agent")
66
  .with_name("DevRaze")
67
+ # CORRECTED: api.VideoGrant changed to api.VideoGrants
68
+ .with_grants(api.VideoGrants(room_join=True, room=ROOM_NAME, room_admin=True, hidden=True))
69
  )
70
 
71
  # The `livekit-agent` CLI is the standard way to run agent workers
 
99
  agent_thread.start()
100
 
101
  # Run the Flask app for the frontend and token generation
 
102
  app.run(host="0.0.0.0", port=7860)