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 中搜尋。