DocsGPT - 用于文档搜索和帮助的 GPT 支持的聊天。

Created at: 2023-02-02 19:03:23
Language: Python
License: MIT

文档GPT 🦖

开源文档助手

DocsGPT 是一种尖端的开源解决方案,可简化在项目文档中查找信息的过程。通过集成强大的 GPT 模型,开发人员可以轻松提出有关项目的问题并获得准确的答案。

告别耗时的手动搜索,让 DocsGPT 帮助你快速找到所需的信息。尝试一下,看看它如何彻底改变你的项目文档体验。为其发展做出贡献,并成为人工智能辅助未来的一部分。

例1 例2 例3 例3

生产支持/公司帮助:

我们渴望在将 DocsGPT 部署到实时环境时提供个性化帮助。

🎉 加入 DocsGPT 的黑客节,赢取一件免费的 T 恤!🎉

视频示例文档 gpt

路线图

你可以在此处找到我们的路线图。请不要犹豫,贡献或创建问题,这有助于我们改进 DocsGPT!

我们针对 DocsGPT 优化的开源模型:

名字 基本型号 要求(或类似)
Docsgpt-7b-falcon 猎鹰-7b 1xA10G 显卡
Docsgpt-14b 美洲驼-2-14b 2xA10 显卡
Docsgpt-40b-猎鹰 猎鹰-40b 8xA10G GPU

如果你没有足够的资源来运行它,则可以使用 bitsnbytes 进行量化。

特征

第 9 组

项目结构

  • 应用程序 - Flask 应用程序(主应用程序)。

  • 扩展程序 - Chrome 扩展程序。

  • 脚本 - 为其他库创建相似性搜索索引和存储的脚本。

  • 前端 - 前端使用 Vite 和 React。

快速入门

注意:确保你已安装 Docker

在 Mac OS 或 Linux 上,编写:

./setup.sh

它将安装所有依赖项,并允许你下载本地模型或使用OpenAI。

否则,请参阅本指南:

  1. 下载并打开此存储库

    git clone https://github.com/arc53/DocsGPT.git

  2. 在根目录中创建一个文件,并使用 OpenAI API 密钥将 env 变量设置为 true 或 false,具体取决于你是否想要流式传输答案。它应该看起来像这样:

    .env
    OPENAI_API_KEY
    VITE_API_STREAMING

    API_KEY=Yourkey
    VITE_API_STREAMING=true
    

    请参阅 /.env-template 和 /application/.env_sample 文件中的可选环境变量。

  3. 运行 ./run-with-docker-compose.sh

  4. 导航到 http://localhost:5173/

要停止,只需运行.

Ctrl + C

开发环境

旋转蒙戈和雷迪斯

对于开发,只使用docker-compose.yaml中的两个容器(通过删除除Redis和Mongo之外的所有服务)。请参阅文件 docker-compose-dev.yaml

docker compose -f docker-compose-dev.yaml build
docker compose -f docker-compose-dev.yaml up -d

运行后端

确保已安装 Python 3.10 或 3.11。

  1. 导出所需的环境变量或在文件夹中准备文件:
    .env
    /application
    • 复制.env_sample并使用 和 字段的 OpenAI API 令牌进行创建。
      .env
      API_KEY
      EMBEDDINGS_KEY

(如果你想查看更多配置选项.py请查看应用程序/核心/设置

  1. (可选)创建 Python 虚拟环境:你可以按照 Python 官方文档进行虚拟环境。

a) 在 Mac OS 和 Linux 上

python -m venv venv
. venv/bin/activate

b) On Windows

python -m venv venv
 venv/Scripts/activate
  1. Change to the
    application/
    subdir by the command
    cd application/
    and install dependencies for the backend:
pip install -r requirements.txt
  1. Run the app using
    flask run --host=0.0.0.0 --port=7091
    .
  2. Start worker with
    celery -A application.app.celery worker -l INFO
    .

Start frontend

Make sure you have Node version 16 or higher.

  1. Navigate to the /frontend folder.
  2. Install required packages
    husky
    and
    vite
    (ignore if installed).
npm install husky -g
npm install vite -g
  1. Install dependencies by running
    npm install --include=dev
    .
  2. Run the app using
    npm run dev
    .

Contributing

Please refer to the CONTRIBUTING.md file for information about how to get involved. We welcome issues, questions, and pull requests.

Code Of Conduct

We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the CODE_OF_CONDUCT.md file for more information about contributing.

Many Thanks To Our Contributors

License

The source code license is MIT, as described in the LICENSE file.

Built with 🦜️🔗 LangChain