Spaces:
Sleeping
Sleeping
Update clientCharacter.py
Browse files- clientCharacter.py +8 -3
clientCharacter.py
CHANGED
@@ -7,9 +7,14 @@ from PyCharacterAI import Client
|
|
7 |
|
8 |
# Define the websocket client class
|
9 |
class WebSocketClient2:
|
10 |
-
def __init__(self,
|
11 |
-
|
12 |
-
self.uri =
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# Define a function that will run the client in a separate thread
|
15 |
def run(self):
|
|
|
7 |
|
8 |
# Define the websocket client class
|
9 |
class WebSocketClient2:
|
10 |
+
def __init__(self, clientPort):
|
11 |
+
|
12 |
+
self.uri = f'ws://localhost:{clientPort}'
|
13 |
+
|
14 |
+
if "tokenChar" not in st.session_state:
|
15 |
+
st.session_state.tokenChar = ""
|
16 |
+
if "character_ID" not in st.session_state:
|
17 |
+
st.session_state.character_ID = ""
|
18 |
|
19 |
# Define a function that will run the client in a separate thread
|
20 |
def run(self):
|