From 674e5002d1c72f3ec2e65e15429eb5e8caaf9eeb Mon Sep 17 00:00:00 2001 From: Vikram Sreekanti Date: Wed, 3 Jul 2024 16:12:11 -0700 Subject: [PATCH] [DOCS] Adds RunLLM widget (#2462) This PR adds the RunLLM chat widget to the Daft documentation site. image --- docs/source/_static/custom.js | 16 ++++++++++++++++ docs/source/conf.py | 1 + 2 files changed, 17 insertions(+) create mode 100644 docs/source/_static/custom.js diff --git a/docs/source/_static/custom.js b/docs/source/_static/custom.js new file mode 100644 index 0000000000..59cf174988 --- /dev/null +++ b/docs/source/_static/custom.js @@ -0,0 +1,16 @@ +document.addEventListener("DOMContentLoaded", function () { + var script = document.createElement("script"); + script.type = "module"; + script.id = "runllm-widget-script" + + script.src = "https://widget.runllm.com"; + + script.setAttribute("version", "stable"); + script.setAttribute("runllm-keyboard-shortcut", "Mod+j"); // cmd-j or ctrl-j to open the widget. + script.setAttribute("runllm-name", "Daft"); + script.setAttribute("runllm-position", "BOTTOM_RIGHT"); + script.setAttribute("runllm-assistant-id", "160"); + + script.async = true; + document.head.appendChild(script); +}); diff --git a/docs/source/conf.py b/docs/source/conf.py index 94ceff97f8..ceee5862a5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -62,6 +62,7 @@ html_theme = "sphinx_book_theme" html_static_path = ["_static"] html_css_files = ["header.css", "custom-function-signatures.css"] +html_js_files = ["custom.js"] html_theme_options = { # This is how many levels are shown on the secondary sidebar "show_toc_level": 2,