Skip to content

This is a simple chatbot application that uses Flask and Pinecone. It allows users to ask questions and get answers from a knowledge base.

Notifications You must be signed in to change notification settings

vikadata/chatbot-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot with Flask and Pinecone

This is a simple chatbot application that uses Flask and Pinecone. It allows users to ask questions and get answers from a knowledge base.

Referred to Pinecone's example Chatbot Agents with LangChain, more examples: Examples

Getting Started

Create Pinecone Accout

Sign up free in Pinecone

Installation

  1. create and activate the environment
python3 -m venv .venv
. .venv/bin/activate
  1. Install the dependencies:
pip install Flask
!pip install -qU openai pinecone-client[grpc] langchain==0.0.162 tiktoken datasets

if you got error while installing pinecone-client[grpc], use the following command instead:

pip3 install -U "pinecone-client[grpc]" install -qU openai "pinecone-client[grpc]" langchain==0.0.162 tiktoken datasets

Quick start

  1. Use your own API key, as changing machines or networks can easily result in getting banned replace the following API key with your own API key
YOUR_OPENAI_API_KEY = "YOUR_OPENAI_API_KEY"
YOUR_PINECONE_API_KEY = "YOUR_PINECONE_API_KEY"
YOUR_PINECONE_ENVIRONMENT = "YOUR_PINECONE_ENVIRONMENT"
  1. Start the Flask application
flask --app chatbot run

The chatbot will now be running on http://localhost:5000/.

  1. Training
curl --location --request PUT 'http://127.0.0.1:5000/datasheets/dst111/train' \
  1. Querying
curl --location --request POST 'http://127.0.0.1:5000/chatbots/cb111/conversation_agent' \
--header 'Content-Type: application/json' \
--data-raw '{
    "query": "What is APITable?"
}'

you could change the query parameter if you have another question

About

This is a simple chatbot application that uses Flask and Pinecone. It allows users to ask questions and get answers from a knowledge base.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages