mainbot
1.0.0
多租户无头 RAG 聊天机器人。
这是使用检索增强生成的多租户聊天机器人的简单实现。
其中一些代码来自 Wanderling,但所有游戏特定功能和规则引擎都已被删除(尚未准备好开源)
将example.env
文件复制到.env
更新 openai 和 pinecone 的值。
make dev
打开 http://localhost:8080/swagger-ui/index.html
Spring Profiles 用于配置应用程序。
请参阅一些示例配置(./src/main/resources/)[./src/main/resources/]
可以在 YAML、属性或环境变量中设置配置。
OPENAI_ENABLED=true
OPENAI_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_CHAT_MODEL_ID=gpt-3.5-turbo
PINECONE_ENABLED=true
PINECONE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PINECONE_PROJECT_NAME=my-project
PINECONE_INDEX=my-index
PINECONE_ENVIRONMENT=us-east4-gcp
APP_SECURITY_ENABLED=false
有关更多详细信息,请参阅 application-opensearch.yml 中的应用程序配置。
SPRING_PROFILES_ACTIVE=opensearch
OPENAI_ENABLED=true
OPENAI_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_CHAT_MODEL_ID=gpt-3.5-turbo
OPENSEARCH_URL=https://localhost:9200
如果您将文档存储在存储库中,则可以轻松地将它们上传到 mainbot。
利用 GitHub Action 将文本/markdown 文件直接上传到 mainbot。
name : Upload Files to Mainbot
on :
workflow_dispatch : {} # Manually trigger the workflow
push :
branches :
- main
paths :
- ' docs/** '
- ' README.md '
jobs :
upload :
runs-on : ubuntu-latest
steps :
- name : Checkout repository
uses : actions/checkout@v2
- name : Upload Files
uses : savantly-net/mainbot-github-action@main
with :
glob-patterns : ' *.md ' # Set your file pattern here
namespace : ' /mainbot-documents '
api-url : ' https://mainbot.my-company.apps.savantly.cloud '
client-id : ${{ secrets.MAINBOT_CLIENT_ID }}
client-secret : ${{ secrets.MAINBOT_CLIENT_SECRET }}
token-endpoint : https://oidc.apps.savantly.cloud/realms/savantly/protocol/openid-connect/token
我们还构建了一个 Backstage 插件来与 mainbot 集成。
结合 Github 操作和 Techdocs 插件,您可以使所有文档立即在 Backstage 中可用并可在 mainbot 中搜索。