Spaces:
Paused
Paused
Download pb_hooks/ping_api.js from rr19tech/RetroPocketBaseCMS: direct link, hf CLI and curl.
- Browser
- Download file 595 Bytes
-
https://huggingface.co/spaces/rr19tech/RetroPocketBaseCMS/resolve/main/pb_hooks/ping_api.js
- Command line
-
hf download hf://spaces/rr19tech/RetroPocketBaseCMS/pb_hooks/ping_api.js
-
curl -L -o ping_api.js https://huggingface.co/spaces/rr19tech/RetroPocketBaseCMS/resolve/main/pb_hooks/ping_api.js
595 Bytes
| // pb_hooks/ping_api.js | |
| module.exports = { | |
| invokeGradioSpace: function() { | |
| console.log("Am i getting called"); | |
| import { Client } from "https://cdn.jsdelivr.net/npm/@gradio/client/dist/index.min.js"; | |
| const url = "https://rr19tech-my-proxy.hf.space"; | |
| const app = await Client.connect('https://rr19tech-my-proxy.hf.space'); | |
| const api_method = "call_private_api"; | |
| const userInput = "What is python" | |
| const result = await app.predict(api_method, [userInput]); | |
| // 3. Access the returned data | |
| console.log("Result:", result.data); | |
| return result.data; | |
| }; | |