Update app.py
Browse files
app.py
CHANGED
@@ -101,12 +101,12 @@ def create_output_path(user=None):
|
|
101 |
|
102 |
@cl.on_chat_start # <βββββββββββββββββ the Chainlit context
|
103 |
def init_session():
|
104 |
-
user_session.set('chat_history', [])
|
105 |
-
|
106 |
-
user_session.set(
|
107 |
-
print("
|
|
|
108 |
|
109 |
-
#cl.user_session.set("session_created_at", datetime.now())
|
110 |
#cl.user_session.set("connection_attempts", 0)
|
111 |
#cl.user_session.set("connection_attempts", connection_attempts + 1)
|
112 |
|
@@ -134,6 +134,8 @@ def init_session():
|
|
134 |
@cl.on_message
|
135 |
async def handle_message(message: cl.Message):
|
136 |
#connection_attempts = cl.user_session.get("connection_attempts", 0)
|
|
|
|
|
137 |
user_message = message.content
|
138 |
llm_chain = cl.user_session.get("llm_chain")
|
139 |
memory = cl.user_session.get("memory")
|
|
|
101 |
|
102 |
@cl.on_chat_start # <βββββββββββββββββ the Chainlit context
|
103 |
def init_session():
|
104 |
+
cl.user_session.set('chat_history', [])
|
105 |
+
cl.user_session.set('path_out', create_output_path())
|
106 |
+
cl.user_session.set("session_created_at", datetime.now())
|
107 |
+
#print("chat_history: ", cl.user_session.get('chat_history'))
|
108 |
+
#print("path_out: ", cl.user_session.get('path_out'))
|
109 |
|
|
|
110 |
#cl.user_session.set("connection_attempts", 0)
|
111 |
#cl.user_session.set("connection_attempts", connection_attempts + 1)
|
112 |
|
|
|
134 |
@cl.on_message
|
135 |
async def handle_message(message: cl.Message):
|
136 |
#connection_attempts = cl.user_session.get("connection_attempts", 0)
|
137 |
+
session_created_at = cl.user_session.get("session_created_at", datetime.now())
|
138 |
+
path_out = cl.user_session.get('path_out')
|
139 |
user_message = message.content
|
140 |
llm_chain = cl.user_session.get("llm_chain")
|
141 |
memory = cl.user_session.get("memory")
|