A basic text prompt is a single string containing an instruction or question for an AI model. It suits a single-turn request, such as a one-off query. In a web app, the request may start in the UI, pass through backend processing, reach a model, and return as generated content. section 5.1.2 section 1.2.2
generateText({
prompt: 'Hello, what is your name?',
model: model("models/gemini-2.0-flash")
});
A minimal Vercel AI SDK call passes the string through the `prompt` property of `generateText`, alongside a model. section 5.1.2
A single `prompt` is effectively a `messages` array containing one user message, but it cannot carry conversation history. Use role-labeled messages when an interaction needs earlier turns, extra context, or attachments. A separate `system` property can set behavior for the conversation. section 5.1.2
Make the instruction useful and economical:
- Specify the requested result. “List 5 popular programming languages” constrains the answer more clearly than “List some popular programming languages.” section 5.2.1
- Include representative input–output examples when the model must follow a pattern or adapt its tone; end by telling it how to handle the new input. section 5.2.2
- Account for input and output tokens when estimating service costs; natural-language input is tokenized before model processing. section 5.1.1
For reusable application instructions, an MCP server can register a named prompt that returns messages, including text assembled from an argument. That server-defined prompt is a separate integration pattern from passing a one-off string to `generateText`. section 12.4.1 section 5.1.2

















































