Hi,
I am upgrading a personal project from AI SDK 3.0 to 3.4. Pretty new to programming and am trying to learn by example.
I have replaced StreamingTextResponse and can successfully stream a completion back to the client using the below code.
const result = await streamText({
model: azure2('gpt4o'),
prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});
return result.toDataStreamResponse();
My question is how would I go about streaming some static text / string (which is not from a completion). I previously had the below code as an example.
const stream = Readable.from("hello");
return new Response(stream, {
headers: {
createdAt: new Date().toISOString(),
},
});
Thank you very much.