Spaces:
Paused
Paused
netman19731
commited on
Commit
•
b3e4e8a
1
Parent(s):
556fce4
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ class AgentState(TypedDict):
|
|
21 |
messages: Annotated[Sequence[BaseMessage], operator.add]
|
22 |
|
23 |
import time
|
24 |
-
import
|
25 |
|
26 |
def generate_token(apikey: str, exp_seconds: int):
|
27 |
try:
|
@@ -35,7 +35,7 @@ def generate_token(apikey: str, exp_seconds: int):
|
|
35 |
"timestamp": int(round(time.time() * 1000)),
|
36 |
}
|
37 |
|
38 |
-
return
|
39 |
payload,
|
40 |
secret,
|
41 |
algorithm="HS256",
|
|
|
21 |
messages: Annotated[Sequence[BaseMessage], operator.add]
|
22 |
|
23 |
import time
|
24 |
+
from jwt import PyJWT
|
25 |
|
26 |
def generate_token(apikey: str, exp_seconds: int):
|
27 |
try:
|
|
|
35 |
"timestamp": int(round(time.time() * 1000)),
|
36 |
}
|
37 |
|
38 |
+
return PyJWT.encode(
|
39 |
payload,
|
40 |
secret,
|
41 |
algorithm="HS256",
|