You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
install the "ai" and the "@ai-sdk/openai" package and build the following example...
node -v
v20.16.0
tsc -v
Version 5.5.4
Code example
import{createOpenAI}from'@ai-sdk/openai';import{generateText}from'ai';asyncfunctionmain(){letopenai=createOpenAI({apiKey: OpenAIKey});letresponse=awaitgenerateText({model: openai("gpt-4o-mini"),prompt: "What is the meaning of life?",});console.log(response);}main();
Additional context
No response
The text was updated successfully, but these errors were encountered:
workaround: install openai package as dev dependency
JSX import - will be fixed in 4.0, until then the (deprecated) property needs to stay for backwards compat. Workaround: add a dev dependency on "@types/react": "^18"
Description
install the "ai" and the "@ai-sdk/openai" package and build the following example...
node -v
v20.16.0
tsc -v
Version 5.5.4
Code example
Additional context
No response
The text was updated successfully, but these errors were encountered: