rr19tech's picture
Checking on a log statement
0f27d1c verified
Raw History Blame Contribute Delete
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;
};