Skip to content

Commit

Permalink
Type participant kind (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao authored Oct 1, 2024
1 parent 4d212f0 commit 9e0e452
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions livekit-api/livekit/api/access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import datetime
import os
import jwt
from typing import Optional, List
from typing import Optional, List, Literal

DEFAULT_TTL = datetime.timedelta(hours=6)
DEFAULT_LEEWAY = datetime.timedelta(minutes=1)
Expand Down Expand Up @@ -84,6 +84,8 @@ class Claims:


class AccessToken:
ParticipantKind = Literal["standard", "egress", "ingress", "sip", "agent"]

def __init__(
self,
api_key: Optional[str] = None,
Expand Down Expand Up @@ -118,8 +120,8 @@ def with_sip_grants(self, grants: SIPGrants) -> "AccessToken":
def with_identity(self, identity: str) -> "AccessToken":
self.identity = identity
return self
def with_kind(self, kind: str) -> "AccessToken":

def with_kind(self, kind: ParticipantKind) -> "AccessToken":
self.claims.kind = kind
return self

Expand Down
2 changes: 1 addition & 1 deletion livekit-api/livekit/api/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.0"
__version__ = "0.7.1"

0 comments on commit 9e0e452

Please sign in to comment.