From f954d0715c8b68e780aac4a4f3ffd1ab56bebfcd Mon Sep 17 00:00:00 2001 From: Chenggang Wu Date: Sat, 27 Jul 2024 09:24:46 -0700 Subject: [PATCH] [Docs] Add RunLLM chat widget (#6857) --- docs/source/_static/custom.js | 16 ++++++++++++++++ docs/source/conf.py | 2 ++ 2 files changed, 18 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 000000000000..f475be71fc44 --- /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", "vLLM"); + script.setAttribute("runllm-position", "BOTTOM_RIGHT"); + script.setAttribute("runllm-assistant-id", "207"); + + script.async = true; + document.head.appendChild(script); + }); \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index b867bfd89dc1..1093b30bca11 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -68,6 +68,8 @@ 'use_repository_button': True, 'use_edit_page_button': True, } +html_static_path = ["_static"] +html_js_files = ["custom.js"] # see https://docs.readthedocs.io/en/stable/reference/environment-variables.html # noqa READTHEDOCS_VERSION_TYPE = os.environ.get('READTHEDOCS_VERSION_TYPE')