Download docs/javascripts/copilot.js from iscc/iscc-sct: direct link, hf CLI and curl.
- Browser
- Download file 889 Bytes
-
https://huggingface.co/spaces/iscc/iscc-sct/resolve/main/docs/javascripts/copilot.js
- Command line
-
hf download hf://spaces/iscc/iscc-sct/docs/javascripts/copilot.js
-
curl -L -o copilot.js https://huggingface.co/spaces/iscc/iscc-sct/resolve/main/docs/javascripts/copilot.js
889 Bytes
| /** | |
| * Mount the ISCC-AI copilot chat widget with anonymous authentication. | |
| * | |
| * Shared across all ISCC documentation sites. Do not modify per project. | |
| * | |
| * Fetches a JWT token from the copilot-token endpoint, then mounts the | |
| * Chainlit copilot widget with the token for cross-origin authentication. | |
| */ | |
| window.addEventListener("load", async function () { | |
| if (typeof window.mountChainlitWidget !== "function") return; | |
| var server = "https://iscc.ai"; | |
| var tokenUrl = server + "/api/copilot-token"; | |
| try { | |
| var response = await fetch(tokenUrl); | |
| var data = await response.json(); | |
| window.mountChainlitWidget({ | |
| chainlitServer: server, | |
| theme: "light", | |
| accessToken: data.accessToken, | |
| customCssUrl: window.location.origin + "/stylesheets/copilot.css?v=7", | |
| }); | |
| } catch (e) { | |
| console.warn("ISCC-AI copilot: failed to fetch token", e); | |
| } | |
| }); | |