From e107fd5630b4d1fca14ff17027729497bcdcae7e Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 16 Sep 2024 02:06:28 -0700 Subject: [PATCH] Add RunLLM chat widget to TorchMetrics (#2732) --- docs/source/_static/runllm.js | 15 +++++++++++++++ docs/source/conf.py | 1 + 2 files changed, 16 insertions(+) create mode 100644 docs/source/_static/runllm.js diff --git a/docs/source/_static/runllm.js b/docs/source/_static/runllm.js new file mode 100644 index 00000000000..8054f5a5051 --- /dev/null +++ b/docs/source/_static/runllm.js @@ -0,0 +1,15 @@ +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("runllm-keyboard-shortcut", "Mod+j"); // cmd-j or ctrl-j to open the widget. + script.setAttribute("runllm-name", "TorchMetrics"); + script.setAttribute("runllm-position", "BOTTOM_RIGHT"); + script.setAttribute("runllm-assistant-id", "244"); + + script.async = true; + document.head.appendChild(script); +}); diff --git a/docs/source/conf.py b/docs/source/conf.py index d7a68156a9e..fcdfae97cc9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -220,6 +220,7 @@ def _set_root_image_path(page_path: str) -> None: # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_css_files = ["css/custom.css"] +html_js_files = ["runllm.js"] # -- Options for HTMLHelp output ---------------------------------------------