Code Monkey home page Code Monkey logo

langchain-chatbot's Introduction

langchain-chatbot

Langchain-Chatbot 是基于 Langchain 框架的检索式和生成式聊天机器人。该机器人能够以对话的方式理解并回应用户的输入​1​。

Running by command

pip install -r requirements.txt

copy env

cp .template.env .env

edit env

配置你自己的environment,包括openai-key和科学上网代理

构建知识库

运行以下命令构建知识库

python ingest.py

run chatbot

运行以下命令启动聊天机器人

python chatbot.py

运行应用

运行以下命令启动应用

python app.py

通过HTTP服务器测试

您可以通过向 'http://127.0.0.1:9000/chat' 发送 POST 请求,其 JSON 主体包含聊天机器人要响应的文本,来测试聊天机器人。例如:

curl --location --request POST 'http://127.0.0.1:9000/chat' \
--header 'Content-Type: application/json' \
--data-raw '{
	"text": "你好"
}'

docker构建

运行以下命令构建Docker镜像并启动Docker容器

docker-compose up -d

进程管理工具 supervisor

您可以使用 Supervisor 来管理进程。这里是一些有用的命令:

  • 查看进程 supervisorctl status
  • 查看进程日志 supervisorctl tail -f clash
  • 查看进程日志文件 /var/log/clash.log

langchain过河记系列文章

langchain-chatbot's People

Contributors

gaoq1 avatar

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.