Your first ai_sdk call – generate a greeting with one function.
generate_text
helper.Install dependencies
OPENAI_API_KEY
is set.Create a model instance & generate text
openai()
returns a LanguageModel wrapper that talks to the OpenAI Chat Completions API.generate_text()
sends the prompt, waits for the response, and returns a typed
GenerateTextResult
.