Skip to content

Commit 9e0e452

Browse files
authored
Type participant kind (#272)
1 parent 4d212f0 commit 9e0e452

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

livekit-api/livekit/api/access_token.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import datetime
1919
import os
2020
import jwt
21-
from typing import Optional, List
21+
from typing import Optional, List, Literal
2222

2323
DEFAULT_TTL = datetime.timedelta(hours=6)
2424
DEFAULT_LEEWAY = datetime.timedelta(minutes=1)
@@ -84,6 +84,8 @@ class Claims:
8484

8585

8686
class AccessToken:
87+
ParticipantKind = Literal["standard", "egress", "ingress", "sip", "agent"]
88+
8789
def __init__(
8890
self,
8991
api_key: Optional[str] = None,
@@ -118,8 +120,8 @@ def with_sip_grants(self, grants: SIPGrants) -> "AccessToken":
118120
def with_identity(self, identity: str) -> "AccessToken":
119121
self.identity = identity
120122
return self
121-
122-
def with_kind(self, kind: str) -> "AccessToken":
123+
124+
def with_kind(self, kind: ParticipantKind) -> "AccessToken":
123125
self.claims.kind = kind
124126
return self
125127

livekit-api/livekit/api/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.0"
1+
__version__ = "0.7.1"

0 commit comments

Comments
 (0)