-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue on integrating chat resume. #120
Comments
Use triple ticks ``` for multiline code:
I suggest you set debugging in your app.py and step through it. Just from the looks of it, you're trying to pass a list of messages to cl.Message's init, you'd need to interate through them individually and send |
Can you send me some examples how I can send the Message in iterations? |
Was just looking at the example in the cookbook: Setting cl.user_session memory like you're doing should be sufficient to bring the messages back into the UX, you only want to call Message.send if you want to provide an additional message back to the user. |
Hi @dahifi |
My complete code file
|
In resume chat I am seting the user session memory but still does not show the previous message on browser. |
I am also facing same problem message history not updating on UI You can take a look of my tries - https://github.com/geekharsh/python/blob/main/chainlit_ui.py |
@geekharsh |
Provide me permission to acces this Repo. |
@geekharsh |
Thanks a lot, |
@Rajatkhanna801 Good work bro, But i have a question, I am looking at the way in which, the user click on new chat, the current chat will go in chat history will reflect on chat history box, Right now it is appearing after manual page refresh. |
Yes right @geekharsh |
Hi All,
I am sqlite as data persistence layer and Microsoft Authentication. I want to fix chat resume feature for my application. Can anyone help me with that.
Here is my code.
@cl.on_chat_resume
async def on_chat_resume(thread: cl_data.ThreadDict):
memory = []
root_messages = [m for m in thread["steps"] if m["parentId"] == 'None']
for message in root_messages:
if message["type"] == "user_message":
memory.append({"role": "user", "content": message["output"]})
else:
memory.append({"role": "assistant", "content": message["output"]})
cl.user_session.set("memory", memory)
await cl.Message(memory).send()
![Uploading Screenshot from 2024-04-02 17-51-59.png…]()
The text was updated successfully, but these errors were encountered: