Skip to content
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

Seed chat history #132

Open
Dobby89 opened this issue Oct 17, 2019 · 6 comments
Open

Seed chat history #132

Dobby89 opened this issue Oct 17, 2019 · 6 comments
Labels

Comments

@Dobby89
Copy link

Dobby89 commented Oct 17, 2019

Is there a way to Seed/save/rehydrate/keep/preserve the chat history from local storage or a cookie or something?

I'm thinking of a use case where the user is browsing from page to page and the chat history has to be preserved across page reloads so the user isn't presented with a clear chat every time.

@fortesl
Copy link

fortesl commented Nov 17, 2019

use google firebase

@tabrza
Copy link

tabrza commented Apr 21, 2020

@Dobby89 - I'm currently trying to do the same with Amazon Lex. Did you manage to figure this out?

@Dobby89
Copy link
Author

Dobby89 commented Apr 21, 2020

@tabrza I ended up making my own chat bot because it had too many custom requirements, so not exactly.

But I did use localstorage to persist certain state properties between page refreshes. For the conversation history I'm using a dynamo DB, but obviously any DB would suffice.

@tabrza
Copy link

tabrza commented Apr 21, 2020

Got it! Would you feel comfortable sharing the code/repo? As you probably saw, I'm trying to get this working with Amazon Lex - just trying to finish the final step of front-end interaction..

@Bonfims
Copy link

Bonfims commented Sep 18, 2020

we can assume that we already have his backend / database part, so we just need to know how we can fill the chat with previous messages with things (like timestamp).

@Bonfims
Copy link

Bonfims commented May 28, 2023

we can assume that we already have his backend / database part, so we just need to know how we can fill the chat with previous messages with things (like timestamp).

From this PR #275 we can active a history by

messages.forEach(({ who, message, messageId, date }) => {
  if(who == 'client')
      addUserMessage(message, messageId, date);
  else
      addResponseMessage(message, messageId, date);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants