Download index.html from Apex123/Chat: direct link, hf CLI and curl.
- Browser
- Download file 864 Bytes
-
https://huggingface.co/spaces/Apex123/Chat/resolve/main/index.html
- Command line
-
hf download hf://spaces/Apex123/Chat/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Apex123/Chat/resolve/main/index.html
864 Bytes
| <html> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Open WebUI 模擬版</title> | |
| <script> | |
| async function callAPI() { | |
| const res = await fetch("https://huggingface.co/spaces/Apex123/Chat/v1/chat/completions", { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json" | |
| }, | |
| body: JSON.stringify({ | |
| model: "gpt-4", | |
| messages: [{ role: "user", content: "你好嗎?" }] | |
| }) | |
| }); | |
| const data = await res.json(); | |
| document.getElementById("result").innerText = data.choices?.[0]?.message?.content || "沒有回應"; | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <h1>Open WebUI 前端(連接到 API)</h1> | |
| <button onclick="callAPI()">送出測試訊息</button> | |
| <pre id="result">尚未請求</pre> | |
| </body> | |
| </html> | |