[Feat Request] Add AIStreamCallbacksAndOptions
for simple text stream response.
#1964
Labels
AIStreamCallbacksAndOptions
for simple text stream response.
#1964
Feature Description
Also for simple text stream responses (via
toTextStreamResponse()
or other methods), we should be able to useAIStreamCallbacksAndOptions
(onStart, onToken, onFinish, etc.).Use Case
Raw stream data protocol has been changed in version
3.1
or later.I upgraded to version 3.1 and
StreamingTextResponse
stopped streaming simple text responses. The new format is now ->0: "Je"
,0: " suis"
,0: "des"
.However, this method does support
AIStreamCallbacksAndOptions
.So, for simple text responses, I found the method
toTextStreamResponse
.But, afaik it doesn't support
AIStreamCallbacksAndOptions
, which I require in my case. Specifically, I would like to know exactly when the stream processing starts (i.e., theonStart
use case).(note: I have a Chrome extension,
useChat
oruseCompletion
can't be used. I implemented an HTTP streaming response handler for streaming in the extension.)Additional context
...
The text was updated successfully, but these errors were encountered: