Closed sebderhy closed 1 year ago
are you using the langchain_factory
decorator or on_chat_start
? If so they are considered a "task" and the user has to wait for them to finish before typing.
I'm using on_chat_start. Here's my code more precisely:
def create_output_path(user=None):
this_uuid = str(uuid.uuid4())
ts = round(time.time())
dt_object = datetime.fromtimestamp(ts)
date = str(dt_object).replace(" ","_").replace(":","-")
path_out = Path(f"./logs/{date}--{user}--{this_uuid}") if user else Path(f"./logs/{date}--{this_uuid}")
path_out.mkdir(exist_ok=True, parents=True)
return path_out
@cl.on_chat_start
def init_session():
user_session.set('chat_history', [])
print("chat_history: ", user_session.get('chat_history'))
user_session.set('path_out', create_output_path())
print("path_out: ", user_session.get('path_out'))
This should not happen, which version of chainlit did you deploy?
0.4.0
I just tried upgrading to the new version, and it didn't help
I am going to investigate
Hi, any news regarding this? I was hoping to release several chatbots powered by Chainlit on Monday morning, but currently, this bug is blocking me (I've tried to share my chatbots to a few people, and they didn't understand why there was this "Stop task" and how they could start the chat). Any chance it will be fixed by then?
Btw, for what it's worth, the problem disappears when I remove the init_session
function, and use the chatbot without session data (but it's not ideal, because then it means I'm completely unable to track anything in the chatbots I release).
Issue solved by @willydouhard ! Turns out the issue was in my NGINX conf, it didn't have any specific configuration for WebSocket connections. I just added those lines and it worked
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Sometimes (not always though), when I access the URL at which I deployed the Chainlit app, there seems to be a task running, which prevents me to start the chat (see below)![image](https://github.com/Chainlit/chainlit/assets/13600027/974ed5b3-fb43-471e-87f8-88569ff045b5)
Thankfully, I can still start the chat by clicking "Stop Task" and then start chatting (see below)![image](https://github.com/Chainlit/chainlit/assets/13600027/0744eb1c-606a-49ae-9052-d050d1cd7658)