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

Feature: WrenAI API endpoint as UserPromptText-to-SQL_Query converter tool: Web Socket #331

Open
qdrddr opened this issue May 28, 2024 · 2 comments
Labels

Comments

@qdrddr
Copy link
Contributor

qdrddr commented May 28, 2024

Is your feature request related to a problem? Please describe.
WrenAi can serve as WrenAI API endpoint as UserPromptText-to-SQL_Query converter tool. Currently, web socket is not supported, you have to keep pooling to check the status of askingTask.

Describe the solution you'd like
Add support of the web socket so the WrenAI can push the result once it is ready to my webhook.

Describe alternatives you've considered
you have to keep pooling to check the status of askingTask.

Additional context
Previous issue:
Canner/wren-engine#566

Guides on how to trace the API work in the Discord channel (without websocket)
https://discord.com/channels/1227143286951514152/1238353430985179208/1240650085474369617

@cyyeh
Copy link
Member

cyyeh commented May 29, 2024

@qdrddr Thanks for raising this feature request. I am also considering use Server-Sent-Events to do the job. In this use case, when users ask questions, underneath they are normal http requests. For getting the response, the server(wren-ai-service) would send the response spontaneously once there is new result. I am curious what's your thought here?

reference: WebSockets vs Server-Sent-Events vs Long-Polling vs WebRTC vs WebTransport

@qdrddr
Copy link
Contributor Author

qdrddr commented May 31, 2024

I do not have experience with SSE, bit it looks promising.
In addition to SSE you might want to also consider adding a URL with the initial request to WrenAI, that is used as a web-hook once the response is ready. So users would have choice between more advanced streaming SSE and simple web hook. @cyyeh

@cyyeh cyyeh added the module/ai-service ai-service related label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants