Coder Social home page Coder Social logo

limcheekin / serverless-flutter-gpt Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 239.67 MB

FlutterGPT - AI chatbot powered by OpenAI API, Qdrant, LangChain and AWS Lambda

Home Page: https://github.com/limcheekin/serverless-flutter-gpt#readme

License: MIT License

Python 0.01% HTML 99.33% CSS 0.62% JavaScript 0.05%
chatbot langchain openai-api qdrant aws-lambda serverless-framework

serverless-flutter-gpt's Introduction

๐Ÿค– FlutterGPT ๐Ÿค–

An AI chatbot that can answer questions about Flutter. It is powered by OpenAI API and LangChain framework, and hosted in AWS Lambda and Qdrant Cloud. Feel free to chat with the bot via Telegram.

Therefore, for the correct operation of the chatbot, it is necessary to:

๐Ÿ“ Table of Contents

โ„น๏ธ General Information

  • The chatbot's knowledge is based on information from the Flutter documentation website, which is hosted at https://docs.flutter.dev/ and was last updated in March 2023. The static HTML files are stored in the site directory.
  • Generate embeddings from the static HTML files using the OpenAI API and save them to Qdrant Cloud.
  • Utilize the Serverless Framework to deploy the handler.py code to AWS Lambda.
  • Access the Lambda URL to ask questions and receive responses.
  • The blog post "ChatGPT Over Your Data" provides a clear explanation of how the chatbot operates behind the scene.

๐Ÿ’ป Technologies Used

  • langchain
  • openai
  • qdrant_client

๐ŸŒŸ Features

  • Using OpenAI API and language model (ChatGPT) with custom knowledge base.
  • Potential multi-channels support

๐Ÿ‘€ Requirements For Initial Setup

  • Install Python, should work with any python version 3.9 and above
  • NodeJS and Serverless Framework is not needed unless you want to deploy the code and run serverless commands from your own PC. It is optional.

๐Ÿ“Ÿ Setup

1. ๐Ÿ’พ Clone/Download the Repository

2. ๐Ÿ“ฆ Create Virtual Environment and Install Dependencies:

$ cd serverless-flutter-gpt
$ python -m venv venv # create virtual environment "venv"
$ source venv/bin/activate # activate it
$ pip install -r requirements.txt

3. ๐Ÿ“” Setup environment variables

Append the following environment variables to the venv/bin/activate file:

export QDRANT_URL = "<The URL of the cluster in Qdrant cloud>"
export QDRANT_API_KEY= "<The API key of the Qdrant cloud account>"
export OPENAI_API_KEY = "<The API key of the OpenAI API>"

Re-run the following command to activate environment variables:

$ source venv/bin/activate

Notes:

Remember to configure the environment variables above manually to Lambda once it is deploy successfully as the step is not implemented in continuous deployment.

4. ๐Ÿ†• Ingest Data (Create Embeddings)

$ python create_embeddings.py

5. ๐Ÿš€ Continuous Deployment to AWS Lambda

The code of querying API handler.py of the chatbot is continuous deploy and test by GitHub Action using Serverless Framework on every git push. Please look into the .github/workflows/dev.yml file to find out more.

Credentials is needed for AWS deployment, add AWS_KEY and AWS_SECRET to the repository secrets at https://github.com/<username>/<repo>/settings/secrets/actions.

๐Ÿ’ฌ Contact

Created by @limcheekin - feel free to contact me!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.