Skip to content

Commit c65396b

Browse files
committed
Merge branch 'feature/deploy_chatbot' into 'master'
feature: deploy chatbot in online docs See merge request ae_group/esp-iot-solution!1239
2 parents 3621aa6 + f7da686 commit c65396b

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

docs/_static/js/chatbot_widget.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#kapa-widget-container {
3+
z-index: 10000 !important;
4+
position: absolute !important;
5+
}
6+
7+
.mantine-Modal-root {
8+
z-index: 10000;
9+
position: absolute;
10+
}

docs/_static/js/chatbot_widget.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
document.addEventListener("DOMContentLoaded", function () {
3+
var script = document.createElement("script");
4+
script.src = "https://widget.kapa.ai/kapa-widget.bundle.js";
5+
script.setAttribute("data-website-id", "4f47d0c5-ab75-4808-877d-eeb96559cd84");
6+
script.setAttribute("data-project-name", "ESP-IoT-Solution");
7+
script.setAttribute("data-project-color", "#C62817");
8+
script.setAttribute("data-project-logo", "https://dl.espressif.com/public/logo.png");
9+
script.setAttribute("data-button-image", "https://dl.espressif.com/chatbot/Chatbot.png");
10+
script.setAttribute("data-button-text-font-size", "0px");
11+
script.setAttribute("data-button-border-radius", "50%");
12+
script.setAttribute("data-button-bg-color", "#38393a");
13+
script.setAttribute("data-button-border", "#38393a");
14+
script.setAttribute("data-button-height", "52px");
15+
script.setAttribute("data-button-width", "52px");
16+
script.setAttribute("data-button-animation-enabled", "false");
17+
script.setAttribute("data-button-image-height", "100%");
18+
script.setAttribute("data-button-image-width", "100%");
19+
script.setAttribute("data-button-padding", "0");
20+
script.setAttribute("data-button-hover-animation-enabled", "false");
21+
script.setAttribute("data-button-position-top", "10px");
22+
script.setAttribute("data-button-position-left", "1048px");
23+
script.setAttribute("data-button-box-shadow", "0px 6px 12px 1px rgba(0,0,0,0.16)");
24+
script.setAttribute("data-modal-override-open-class", "test-ai");
25+
script.setAttribute("data-modal-disclaimer", "This custom large language model (LLM), trained on official documentation from espressif.com, is designed to provide technical support and answers related to Espressif’s products and services. Give it a try, share your thoughts, and let us know your feedback—we truly appreciate it! \n\n**Note**: AI-generated information may be incomplete or inaccurate. Always verify critical information with official sources.");
26+
script.setAttribute("data-modal-example-questions", "How to add button to my project?,Does ESP32-S3 support USB Camera?");
27+
script.async = true;
28+
document.head.appendChild(script);
29+
});

docs/conf_common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
# relative to this directory. They are copied after the builtin static files,
3636
# so a file named "default.css" will overwrite the builtin "default.css".
3737
html_static_path = ['../_static']
38+
html_js_files = ['js/chatbot_widget.js']
39+
html_css_files = ['js/chatbot_widget.css']
3840

3941
versions_url = './_static/js/generic_version.js'
4042

0 commit comments

Comments
 (0)