Skip to content

How to pass a history key to a call to /chat? #105

Closed Answered by Und3rf10w
Und3rf10w asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I think you can just use:

messages = langchain.schema.messages.from_dict(json.loads(request.chat_history))
for message in messages:
    langchain_object.memory.chat_memory.add_message(message)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Und3rf10w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant