Text prompts
Text prompts are the simplest form - just a string. They are ideal for simple generation use cases.Dynamic prompts
You can use template literals to provide dynamic data:System prompts
System prompts are instructions that guide the model’s behavior and responses. They work with both text and message prompts.Message prompts
Message prompts are arrays of messages with different roles. They’re great for chat interfaces and multi-turn conversations.Basic messages
Multi-modal messages
Messages can include multiple content types:Text parts
Image parts
Images can be provided as buffers, base64 strings, or URLs:File parts
Some models support file attachments like PDFs:Message roles
User messages
User messages represent input from the user:Assistant messages
Assistant messages represent previous responses from the model:System messages
System messages provide context and instructions:Tool messages
Tool messages contain the results of tool executions:Provider options
You can pass provider-specific metadata at different levels:Function level
Message level
Message part level
Prompt conversion
The AI SDK converts prompts to the format required by each provider:convertToLanguageModelPrompt function in the SDK core.