Thread
Build a ChatGPT like Simple Chatbot and deploy that with just a few lines of code🔥

Let me break it down for you in this thread:👇
The goal is to build a simple chatbot like ChatGPT which can answer to specific questions🤖

Tech stack required🛠

1. Langchain AI: Python package that provides a lots of integrations with tools like Open AI, HF and also end-to-end chains for diff applications

2. Steamship
Steamship to host the APP the best part is it comes with an integration to langchain that makes it super easy to build and host the chatbot directly.

To make it simple and easy to understand, Let's break the code into two Python scripts:

Let's look at how we can implement it 🚀
Add Flask-style endpoints and customize the bot by defining the chain.

Below you can see two endpoints

1. To generate a Response for a Text - "send_message"

2. To give the full chat history - "transcript"

Similarly add endpoints for your usecases.

Server-side code:👇
Now define the client side that helps the user to interact with the Bot.

Client side code: 👇
Deploy and Share 🚀

Now all you need to do is add "requirements. txt" and "steamship .json" files mentioning the dependencies and details of the app.

Then it's that simple to deploy using the command "ship deploy" and get an instant endpoints of the app.
Chatbot is one such example of Lang Chain AI and the applications are endless.

For a detailed explanation and to build more such applications with Langchain, check out the source code and docs👇

Source Code - github.com/steamship-core/steamship-langchain/tree/main/examples/chatbot

Docs: www.steamship.com/build/langchain-apps
Every day, I share tutorials and simplify complex topics around Python, Machine Learning & Language Models.

Follow me → @Sumanth_077 ✅ to ensure you don't miss that.

Like/RT the first tweet to support my work and help this reach more people.
Mentions
See All