Spaces:
Sleeping
Sleeping
Update Gradio API documentation for public apps; specify production endpoint and response details
Browse files- gradio-api.md +22 -4
gradio-api.md
CHANGED
@@ -47,14 +47,32 @@ event: complete
|
|
47 |
data: [ ... ]
|
48 |
```
|
49 |
|
50 |
-
|
51 |
-
|
|
|
52 |
|
53 |
```powershell
|
54 |
-
curl.exe -X POST
|
55 |
```
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
## Notes
|
60 |
- For Gradio apps with multiple inputs, adjust the `data` array in `payload.json` accordingly.
|
|
|
47 |
data: [ ... ]
|
48 |
```
|
49 |
|
50 |
+
|
51 |
+
## Example for Public Gradio Apps (Production)
|
52 |
+
For the production Gradio Space, use the following endpoint and adjust the payload as needed:
|
53 |
|
54 |
```powershell
|
55 |
+
curl.exe -X POST https://boardflare-mcp-client.hf.space/gradio_api/call/predict -s -H "Content-Type: application/json" -d '@payload.json'
|
56 |
```
|
57 |
|
58 |
+
This returns a JSON response with an `event_id`, e.g.:
|
59 |
+
|
60 |
+
```json
|
61 |
+
{"event_id":"YOUR_EVENT_ID"}
|
62 |
+
```
|
63 |
+
|
64 |
+
Then fetch the result with:
|
65 |
+
|
66 |
+
```powershell
|
67 |
+
curl.exe -N https://boardflare-mcp-client.hf.space/gradio_api/call/predict/YOUR_EVENT_ID
|
68 |
+
```
|
69 |
+
|
70 |
+
You will see output like:
|
71 |
+
|
72 |
+
```
|
73 |
+
event: complete
|
74 |
+
data: [ ... ]
|
75 |
+
```
|
76 |
|
77 |
## Notes
|
78 |
- For Gradio apps with multiple inputs, adjust the `data` array in `payload.json` accordingly.
|