seb
seb
Explore posts from servers
TtRPC
Created by seb on 6/17/2023 in #❓-help
Streaming responses (eg. for streaming ai chat completion text)
Hello! Has anyone used Vercel's ai package or any similar libraries which stream their responses with tRPC? I'm wondering what the best way to achieve a streamed response like that is while maintaining type safety. The trouble with useSubscription() is that it behaves more like a query than a mutation, so it would need to be called immediately when the component mounts rather than being triggered by some user action.
3 replies