Spaces:
Sleeping
Sleeping
| import { Client } from '@gradio/client'; | |
| async function testGradioAPI() { | |
| try { | |
| console.log('Connecting to Gradio...'); | |
| const client = await Client.connect('dentsudigital/mugenAILP_dev', { | |
| hf_token: process.env.GRADIO_TOKEN, | |
| }); | |
| console.log('Connected! Testing check_url endpoint...'); | |
| const result = await client.predict('/check_url', { | |
| own_url: "https://www.dentsu.co.jp/", | |
| url_text: "https://dentsu-ho.com/", | |
| own_image: null, | |
| url_image64_text: "", | |
| own_image_text: null | |
| }); | |
| console.log('Response:', JSON.stringify(result.data, null, 2)); | |
| } catch (error) { | |
| console.error('Error:', error.message); | |
| console.error('Stack:', error.stack); | |
| } | |
| } | |
| testGradioAPI(); | |