Prompt Buddy logoPrompt Buddy

vercel · Vercel AI SDK Docs

AI SDK Foundations: Prompts

Explains the fundamental concepts of prompt engineering within the AI SDK, covering how to structure, manage, and optimize prompts for LLM interactions.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

AI SDK Foundations: Prompts

Explains the fundamental concepts of prompt engineering within the AI SDK, covering how to structure, manage, and optimize prompts for LLM interactions.

When To Use

Use when you need to implement structured prompt patterns or optimize how text instructions are sent to large language models within an application.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/ai-sdk-foundations-prompts-workflow-guide.mdA guide explaining text, system, and message prompt types and provider options within the AI SDK.Questions about a guide explaining text, system, and message prompt types and provider options within the AI SDK.
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-prompt.textA code example demonstrating how to use the generateText function with a text prompt in the Vercel AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a text prompt in the Vercel AI SDK.
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-prompt-2.textA code example demonstrating how to use the generateText function with a template literal prompt in the AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a template literal prompt in the AI SDK.
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-system-prompt.textA code example demonstrating how to use the generateText function with a system prompt to define an AI persona for travel planning.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a system prompt to define an AI persona for tr...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-messages.textA code example demonstrating how to use the generateText function with a messages array containing user and assistant roles.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a messages array containing user and assistant...
examples/ai-sdk-foundations-prompts-generate-text-azure.textA code example demonstrating how to use the generateText function with an Azure OpenAI model and specific provider options.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with an Azure OpenAI model and specific provider op...
examples/ai-sdk-foundations-prompts-model-message-cache-control.textA TypeScript code example demonstrating how to use the ModelMessage type with Anthropic-specific cache control provider options.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the ModelMessage type with Anthropic-specific cache control provid...
examples/ai-sdk-foundations-prompts-ai-sdk-modelmessage-array-structure.textA TypeScript code example demonstrating the structure of the ModelMessage array including text and image content types.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating the structure of the ModelMessage array including text and image content types.
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-prompt-3.textA code example demonstrating how to use the generateText function with a user message to create a prompt using the AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a user message to create a prompt using the AI...
examples/ai-sdk-foundations-prompts-generatetext-multimodal.textA code example demonstrating how to use the generateText function with a multimodal message containing both text and an image.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a multimodal message containing both text and...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-multimodal-prompt.textA code example demonstrating how to use the generateText function with a multimodal prompt containing both text and an image.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a multimodal prompt containing both text and a...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-multimodal-prompt-2.textA code example demonstrating how to use the generateText function with a multimodal prompt containing both text and an image URL.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a multimodal prompt containing both text and a...
examples/ai-sdk-foundations-prompts-ai-sdk-prompts-multimodal.textA TypeScript code example demonstrating how to construct multimodal prompts using text and file data with the AI SDK.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to construct multimodal prompts using text and file data with the AI SDK.
examples/ai-sdk-foundations-prompts-ai-sdk-prompts-multimodal-audio.textA TypeScript code example demonstrating how to use the AI SDK to send multimodal prompts containing both text and audio data to a model.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the AI SDK to send multimodal prompts containing both text and aud...
examples/ai-sdk-foundations-prompts-generatetext-experimental-download.textA code example demonstrating the use of the experimental_download parameter within the generateText function of the AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating the use of the experimentaldownload parameter within the generateText function of the AI...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-messages-2.textA code example demonstrating how to use the generateText function with a messages array in the AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a messages array in the AI SDK.
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-prompt-4.textA code example demonstrating the use of the generateText function with a message array to create a prompt using the AI SDK.Exact payloads, commands, or snippets shown in A code example demonstrating the use of the generateText function with a message array to create a prompt using the A...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-messages-3.textA code example demonstrating the use of the generateText function with a message history containing a user prompt and an assistant tool call.Exact payloads, commands, or snippets shown in A code example demonstrating the use of the generateText function with a message history containing a user prompt and...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-multimodal-messages.textA code example demonstrating how to use the generateText function with multimodal messages containing both text and image data.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with multimodal messages containing both text and i...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-multimodal-messages-2.textA code example demonstrating how to use the generateText function with multimodal messages containing both text and image content.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with multimodal messages containing both text and i...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-tool-result-message.textA text example demonstrating how to construct a tool-result message part within the generateText function using the AI SDK.Exact payloads, commands, or snippets shown in A text example demonstrating how to construct a tool-result message part within the generateText function using the A...
examples/ai-sdk-foundations-prompts-ai-sdk-generatetext-prompt-5.textA code example demonstrating how to use the generateText function with a system message and user message to create a prompt.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the generateText function with a system message and user message to create a...

What This Skill Covers

  • Prompts are instructions that you give a large language model (LLM) to tell it what to do. It's like when you ask someone for directions; the clearer your qu...
  • Main sections: Text Prompts, System Prompts, Message Prompts, Provider Options, Function Call Level.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://ai-sdk.dev/docs/foundations/prompts