Spaces:
Paused
Paused
File size: 595 Bytes
845cd8b 0f27d1c b23ca39 e23617e b23ca39 e23617e 845cd8b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | // 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;
};
|