Build-a-Simple-Chatbot-App

This exercise will use Flowise hosted on Hugging Face to build a LLM-powered English-to-Japanese translator app.
Login to Hugging Face 🤗 and click on the workspace created.
At Chatflow dashboard, click “Add New” , a new “Untitled Chatflow” canvas is created.

The + icon on the top left is to add node.
Click on + icon and search for LLM Chain. Drage it onto the canvas.

Image

Next, search for the ChatOpenAI node and drag onto the canvas.
On the ChatOpenAI node, connect the credential and select the LLM model.
In the ChatOpenAI node, click on Additional Parameters and fill in the various fields as below.

Image 1 Image 2

In the add credential, name the credential and paste your OpenAI API key.
Image

Next, search for Chat Prompt Template node and drag it onto the canvas.

System Message:

You are a helpful, friendly and bilingual assistant. You will be asked for assistance in {input language}. You are to provide two responses. One paragraph in {output language} and the other paragraph in {input language}

Human message:

{text}

Click on the Format Prompt Values. Input the input and output_language and text by clicking on the pen icon (edit).
The input language is English and choose your preferred output language - Japanese, French, Spanish or Chinese.
For text, enter .

Image Image

Connecting the nodes

Connect the output of ChatOpenAI and Chat Prompt Template into the Language Model and Prompt of LLM Chain node respectively.
Save the chatflow and give it an approriate name. The chatbot is ready to start chatting. Image

Here’s a glimspe of the chat messages.
Click here for video demo of the chatbot

Image

Back to Projects Portfolio