davidmigloz / langchain_dart

Build LLM-powered Dart/Flutter applications.
https://langchaindart.dev
MIT License
426 stars 75 forks source link

How to have continous chat with the ai? #528

Closed danieljiwonkang98 closed 2 months ago

danieljiwonkang98 commented 3 months ago

Issue with current documentation:

No documentation on how to have continous chat with the ai knowing previous context?

Idea or request for content:

No response

davidmigloz commented 2 months ago

Hello @danieljiwonkang98 ,

You can use some of the memory classes that LangChain.dart provides, or you can manage the history yourself.

Here you have an example of adding memory to a chain: https://langchaindart.dev/#/expression_language/cookbook/adding_memory

In this other example, the history is handed manually: https://github.com/davidmigloz/langchain_dart/discussions/519#discussioncomment-10298964

Hope that helps!