A smart qa bot that can answer questions based on existing documents.
- Java 1.8+
- Milvus 2.2.0+
- Clone this repo
- Execute
./build.sh
- Upload and unzip the generated
qa-bot-x.x.x.jar
to the server
- Config the
markdown.files.location
to the directory of the markdown files - Config the
markdown.files.scheduleEnabled
totrue
if you want to auto update the markdown files - Config the
milvus.host
andmilvus.port
to the Milvus server - Config the
milvus.useZillzCloud
,milvus.zillizCloudUri
andmilvus.zillizCloudToken
if you are using Zilliz Cloud - Config other parameters as needed
- Config the
OPENAI_API_KEY
to the OpenAI API key - Config the
HTTP_PROXY
to the proxy server if needed
export OPENAI_API_KEY=sk-************************************************
export HTTP_PROXY=http{s}://${username}:${password}@${url}:${port}
- Start the service:
./scripts/startup.sh
- Stop the service:
./scripts/shutdown.sh
- Check the logs:
tail -f /opt/logs/qa-bot.log
- Manually trigger the markdown files processing:
curl http://${your-server-url}:9090/markdown/load
- Test the QA bot via browser:
http://${your-server-url}:9090
Refer apollo pr for an example.
<html>
<head>
...
</head>
<body>
...
</body>
<!-- add qa bot -->
<script>
(function() {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'http://${your-server-url}:9090/qa-bot.css';
document.head.appendChild(link);
var script = document.createElement('script');
script.src = 'http://${your-server-url}:9090/qa-bot.js';
script.onload = function () {
QABot.initialize({
"serverUrl": "http://${your-server-url}:9090/qa",
"documentSiteUrlPrefix": "https://${your-documentation-site-prefix-url}"
});
};
document.body.appendChild(script);
})();
</script>
</html>