-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ai qa bot #4908
add ai qa bot #4908
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4908 +/- ##
============================================
- Coverage 48.51% 48.44% -0.07%
+ Complexity 1728 1727 -1
============================================
Files 346 346
Lines 10836 10836
Branches 1080 1080
============================================
- Hits 5257 5250 -7
- Misses 5256 5263 +7
Partials 323 323 |
docs/index.html
Outdated
@@ -151,6 +156,10 @@ | |||
generateMultipleLanguagesNavbarPluginByListItemName("Translations"), | |||
], | |||
}; | |||
QABot.initialize({ | |||
"serverUrl": "http://81.68.181.139/ai/qa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For simulating the ai backend shutdown,
I change
http://81.68.181.139
to http://81.68.181.100
The document can be open, but would delay 10s .
Is there any way to setup the timeout from 10s to 5s, 3s or 2s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point! I changed the logic as follows and it should work well when 81.68.181.139 is down.
<!-- add qa bot -->
<script>
(function() {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'http://81.68.181.139/ai/qa-bot.css';
document.head.appendChild(link);
var script = document.createElement('script');
script.src = 'http://81.68.181.139/ai/qa-bot.js';
script.onload = function () {
QABot.initialize({
"serverUrl": "http://81.68.181.139/ai/qa",
"documentSiteUrlPrefix": "https://www.apolloconfig.com/#"
});
};
document.body.appendChild(script);
})();
</script>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Idea.
But it is still block on my machine...
Found that
<link rel="stylesheet" href="http://81.68.181.139/ai/qa-bot.css">
<script src="http://81.68.181.139/ai/qa-bot.js"></script>
i.e those 2 lines cause.
When change them to
<link rel="stylesheet" href="http://81.68.181.100/ai/qa-bot.css">
<script src="http://81.68.181.100/ai/qa-bot.js"></script>
We can reproduce it.
After query how to async load css and javascript through ChatGPT, There is a solution
use
<link rel="preload" href="http://81.68.181.139/ai/qa-bot.css" as="style">
<noscript><link rel="stylesheet" href="http://81.68.181.139/ai/qa-bot.css"></noscript>
to async load css, and use
<script src="http://81.68.181.139/ai/qa-bot.js" async></script>
to async load javascript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, looks like the last push failed, these 2 lines should be removed.
<script src="http://81.68.181.139/ai/qa-bot.js"></script>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
Integrate an intelligent QA bot capable of providing natural language responses to users' inquiries.
The source code for the backend Apollo QA bot can be accessed at here and is currently deployed in conjunction with the Apollo demo server, which is why the ip is 81.68.181.139.
Screenshots
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.