Spaces:
Running
Running
Download script.js from Sachin5112/Selflearner: direct link, hf CLI and curl.
- Browser
- Download file 465 Bytes
-
https://huggingface.co/spaces/Sachin5112/Selflearner/resolve/main/script.js
- Command line
-
hf download hf://spaces/Sachin5112/Selflearner/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Sachin5112/Selflearner/resolve/main/script.js
465 Bytes
| document.getElementById("sendBtn").addEventListener("click", async () => { | |
| const input = document.getElementById("userInput").value.trim(); | |
| const output = document.getElementById("response"); | |
| if (!input) return; | |
| output.textContent = "Generating response..."; | |
| try { | |
| const reply = await puter.ai.chat(input, { model: "gemini-2.5-flash" }); | |
| output.textContent = reply; | |
| } catch (err) { | |
| output.textContent = "❌ Error: " + err.message; | |
| } | |
| }); | |