-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
RPC support for SSE #3309
Comments
This is super interesting. @sor4chi @nakasyou @watany-dev @hagishi and others: Any thoughts? Or can you work on it? |
I think it is a good idea! Also I thought, what do you think about typed JSON SSE? |
Great! As you mentioned, it is used in LLM apps often. |
following |
Hi, @yusukebe |
Hi @sor4chi
This means there are differences between the runtime APIs for SSE, right? |
This would be really useful for LLM structured responses. Is it still in the plans to be added? |
@yusukebe |
I am following this package to implement SSE support for my PoC today. How about this version to merge into Hono? P.S. didn't have the error handler and abort controller yet.
|
Are you assuming that you are going to add faet-event-source as a deps in Hono? Or do you mean copying that implementation into Hono and using it? |
In my opinion, we need to copy or re-implement a similar behavior into Hono. The I assume the API may be const res = await agentApi[':name'].conversation.$post(...)
await res.sse({ // SSE is a type of response can be formatted like JSON
onMessage: event => { ... }
}) |
Just adding to the discussion here, an RCP API could also be See Elysia's Eden Treaty client API for streaming responses as a unit of prior art / inspiration for something like this. |
Thank you, everyone! I’ll try implementing it next week. |
I tried https://github.com/Azure/fetch-event-source, but it depends on the document, so in the end, I had to polyfill global. For now, I will add the eventsource polyfill and present the POC, and then leave the rest to @yusukebe’s discretion. |
What is the feature you are proposing?
We require using EventSource to work with SSE routes, but can we have Hono's RPC to have this functionality as well?
The text was updated successfully, but these errors were encountered: