Spaces:
Runtime error
Runtime error
Download customProvider.js from Shriyakupp/iitm_scraper: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/spaces/Shriyakupp/iitm_scraper/resolve/main/customProvider.js
- Command line
-
hf download hf://spaces/Shriyakupp/iitm_scraper/customProvider.js
-
curl -L -o customProvider.js https://huggingface.co/spaces/Shriyakupp/iitm_scraper/resolve/main/customProvider.js
462 Bytes
| module.exports = class CustomAPIProvider { | |
| id() { | |
| return "custom-api"; // Ensure this method correctly returns the provider ID. | |
| } | |
| async callApi(prompt) { | |
| const response = await fetch("http://127.0.0.1:8000/ask", { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ question: prompt }), | |
| }); | |
| const data = await response.json(); | |
| return { output: data.answer }; | |
| } | |
| }; |