Skip to content

neo1202/LangChain_GPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangChain with GPT demo website

*You may need the following api keys:

  • pinecone vector database to store your documents
  • OpenAI Api keys to use llm chains
  • serpapi keys to search for web informations

Start, init

The repo is https://github.com/neo1202/LangChain_GPT.git

Install git (optional, you can just download zip by pressing the green button 'Code')

https://git-scm.com git

Install node package manager(npm)

https://nodejs.org/zh-tw node

After installing the prerequisites, open a new terminal

  1. Go to Desktop
cd ~/Desktop
  1. Clone the repository from Github
git clone https://github.com/neo1202/LangChain_GPT.git
  1. Go into the repo
cd LangChain_GPT

Frontend --- React, tailwind

Go to the client folder

cd client

Install the packages using npm

npm install

run this code, so you can open website http://localhost:8080 to view it in browser.

npm run dev

Backend --- Python - Flask

Open a new terminal and go to the server folder

cd flask-server

Create a config file and place your api keys in it, only when you first clone this repo

The Touch command is not already pre-installed in Windows. Execute the “npm install touch-cli -g” command

touch config.py

Put your Api keys in it

OPEN_API_KEY = "your_api_key_here"
SERP_API_KEY = "your_serpapi_key"
PINECONE_KEY = "your_pinecone_key"

Create virtual environment for depencies

python -m venv .venv

Activate the virtual environment in your terminal

windows
.\.venv\Scripts\activate
mac
. .venv/bin/activate 

Install the depencies for this .venv

pip install -r requirements.txt

run this code to active the backend server

python -m flask run

the server runs at http://127.0.0.1:5000/
you can visit http://127.0.0.1:5000/data to see some msg to ensure you successfully open the server.

Website appearance

img1

How the LangChain work ?

Langchain flow Chart using all in one Agent flow

Tool

Tool - Doc retrieval and answer base on given information docretrieval

Agent with Tools:

Agent concept (reAct paper) -> reason & acting, use given tool to gain more knowledge reAct Agent with Tools

Usecase

Suppose I have 32 cages, and each cage has seven chickens. (Math Chain) case 1 Other tool in practice case 2

Feature Display

上網搜尋資料並總結 \ 內部文件 chat 1 上傳電腦內文件功能(可選資料夾 or 1~多個檔案) chat 2 自帶的寫程式、翻譯功能,並且會有前幾輪對話的記憶 chat 3 依照網址搜尋Youtube影片並照字幕進行總結 chat 4

About

透過langchain實現多功能問答GPT, 包含時事搜尋以及根據內部文件回答, 總結yt影片內容等

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors