You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! Is it possible to update, delete, and insert messages on Langchain SDK?
I have two LLMs that format inputs and outputs, and I need them to be aware of the actual conversation, but I also need to remove the old input/output from the conversation and only keep the formatted ones.
At the moment, I have something like this:
current_messages = zep_chat_history._get_memory()
last_message = current_messages.messages[-1]
# Here I change the role of the last message, from AI to "human"
last_message.role = "human"
current_messages.messages[-1] = last_message
# Here I want to remove the last user's message
current_messages.messages.pop(-2)
# Now I need a method to update the session's messages with these changes
Is there any workaround to achieve this?
I could also use the Python SDK if needed (out of Langchain)
The text was updated successfully, but these errors were encountered:
We don't currently support update or deletion of messages as this requires recalculating artifacts such as summaries and embeddings. We're considering how to do this, but haven't yet settled on an elegant solution.
Hey! Is it possible to update, delete, and insert messages on Langchain SDK?
I have two LLMs that format inputs and outputs, and I need them to be aware of the actual conversation, but I also need to remove the old input/output from the conversation and only keep the formatted ones.
At the moment, I have something like this:
Is there any workaround to achieve this?
I could also use the Python SDK if needed (out of Langchain)
The text was updated successfully, but these errors were encountered: