Closed
Description
Description
The following generation exits early as await result.text
doesn't appear to be blocking as expected.
import { openai } from "@ai-sdk/openai";
import { streamText } from "ai";
import "dotenv/config";
const main = async (prompt: string) => {
const result = streamText({
model: openai("gpt-4.1-mini"),
prompt,
});
console.log(await result.text);
};
main("Hey, how are you?");
AI SDK Version
"@ai-sdk/openai": "2.0.0-alpha.4",
"ai": "5.0.0-alpha.5",
No response