-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
content:newRequest for new/missing contentRequest for new/missing contentdocumentationDocumentation editsDocumentation editsexampleproduct:workers-aiWorkers AI: https://developers.cloudflare.com/workers-ai/Workers AI: https://developers.cloudflare.com/workers-ai/
Description
Which Cloudflare product(s) does this pertain to?
Workers AI
Subject Matter
How to get hold of the ai.run results streamed to the client.
Content Location
https://developers.cloudflare.com/workers-ai
Additional information
ai.run has an option to stream. This stream can be sent to the client.
Please provide a clear example of how one would catch the full result of the stream on the server side in order to log the result, size of the result or anything else about it.
It's very probable that you would want to keep track of answers given to clients, and therefore having the full result is important. this is easily logged in a blocking result, but not when streaming.
the stream produced by ai.stream does not have a .on('data') event which would be what you would expect.
scenaristeur
Metadata
Metadata
Assignees
Labels
content:newRequest for new/missing contentRequest for new/missing contentdocumentationDocumentation editsDocumentation editsexampleproduct:workers-aiWorkers AI: https://developers.cloudflare.com/workers-ai/Workers AI: https://developers.cloudflare.com/workers-ai/