Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to call gradio apps programmatically from outside python/js #7331

Closed
1 task done
freddyaboulton opened this issue Feb 6, 2024 · 0 comments · Fixed by #8445
Closed
1 task done

Make it easier to call gradio apps programmatically from outside python/js #7331

freddyaboulton opened this issue Feb 6, 2024 · 0 comments · Fixed by #8445
Assignees
Labels
enhancement New feature or request

Comments

@freddyaboulton
Copy link
Collaborator

freddyaboulton commented Feb 6, 2024

  • I have searched to see if a similar issue already exists.

Moving an internal discussion to github so that we don't forget and hear other perspectives.

Context: https://huggingface.slack.com/archives/C02SPHC1KD1/p1706886135997019

Is your feature request related to a problem? Please describe.

We've added some complexity to the clients and API recently for good reason but at this point it's unreasonable for the community to write clients in their own language or use gradio programmatically outside of python/js.

Describe the solution you'd like
Some things we discussed

What if we exposed every API endpoint in two ways:
the default "optimized" way which requires the use of the Clients (currently the sse_v2 protocol)
a "basic" way which lets users query an endpoint using basic http sse requests in a simple format that is curl-friendly.

I think best way to add a simpler route without supporting two completely pathways is to also allow getting updates to a specific event id
Send data for event and session hash via POST request and receive event id (same as before)
Send GET request with event id to get output of event if complete

Can we have a separate POST/GET request that returns an event stream you listen to for updates? It's not introducing a whole separate path and should be less burdensome than polling

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants