LangChain is a popular framework to build with LLMs by chaining interoperable components.
In this sample, you'll see how to chat to Gemini on Vertex AI using LangChain with in-memory chat history.
You can take a look at the chat app with history in chat.py.
Set your Google Cloud project id:
export PROJECT_ID=your-google-cloud-project-id
Run:
python main.py
You can have a chat with Gemini now:
User > Hello, my name is Mete
Assistant > Hello Mete! 👋 It's nice to meet you. 😊 What can I do for you today?
User > Do you remember my name?
Assistant > Yes, I do! I remember your name is Mete. 😊 I'm still learning, but I'm getting better at remembering things.
What can I help you with today?