Prompt Buddy logoPrompt Buddy

vercel · Vercel AI SDK Docs

AI SDK Getting Started: Svelte

Initial setup and integration of the AI SDK within a Svelte application environment.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

AI SDK Getting Started: Svelte

Initial setup and integration of the AI SDK within a Svelte application environment.

When To Use

Use when you need to configure and initialize the AI SDK to work with Svelte components and state management.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/ai-sdk-getting-started-svelte-workflow-guide.mdA guide for setting up the Vercel AI SDK in a Svelte application, including API route creation and provider configuration.Questions about a guide for setting up the Vercel AI SDK in a Svelte application, including API route creation and provider configura...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started-env-variable.textAn example of the AI_GATEWAY_API_KEY environment variable configuration for the AI SDK Svelte getting started guide.Exact payloads, commands, or snippets shown in An example of the AIGATEWAYAPIKEY environment variable configuration for the AI SDK Svelte getting started guide.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-streamtext-post-route.textA SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway.Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started.textA basic implementation example of the AI SDK within a Svelte application.Exact payloads, commands, or snippets shown in A basic implementation example of the AI SDK within a Svelte application.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-gateway-import-options.textCode examples demonstrating different methods to import the gateway function from the ai and @ai-sdk/gateway packages in a Svelte environment.Exact payloads, commands, or snippets shown in Code examples demonstrating different methods to import the gateway function from the ai and @ai-sdk/gateway packages...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-openai-model-setup.textA code snippet demonstrating how to initialize an OpenAI model instance within a Svelte application using the AI SDK.Exact payloads, commands, or snippets shown in A code snippet demonstrating how to initialize an OpenAI model instance within a Svelte application using the AI SDK.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio.textA Svelte component implementation demonstrating the use of the Chat class from @ai-sdk/svelte to manage message history and user input.Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating the use of the Chat class from @ai-sdk/svelte to manage message histo...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-stream-text-route-handler.textA SvelteKit POST route handler implementation using the AI SDK to stream text responses via a gateway.Exact payloads, commands, or snippets shown in A SvelteKit POST route handler implementation using the AI SDK to stream text responses via a gateway.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component.textA Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message history and user input.Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message histo...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-post-route-stream.textA SvelteKit server-side POST route implementation using the AI SDK to stream text responses.Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-post-route-stream-2.textA SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway.Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio-2.textA Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message state and user input.Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message state...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-reactive-prop.textA code example demonstrating how to pass reactive props to the Chat class in Svelte to ensure the chat instance updates when the ID changes.Exact payloads, commands, or snippets shown in A code example demonstrating how to pass reactive props to the Chat class in Svelte to ensure the chat instance updat...
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started-2.textA basic implementation example of the AI SDK within a Svelte application.Exact payloads, commands, or snippets shown in A basic implementation example of the AI SDK within a Svelte application.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio-3.textA Svelte code example demonstrating how to initialize and use the Chat component from the AI SDK.Exact payloads, commands, or snippets shown in A Svelte code example demonstrating how to initialize and use the Chat component from the AI SDK.
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-createaicontext-setup.textA Svelte implementation demonstrating how to initialize the AI SDK context using createAIContext.Exact payloads, commands, or snippets shown in A Svelte implementation demonstrating how to initialize the AI SDK context using createAIContext.

What This Skill Covers

  • The AI SDK is a powerful TypeScript library designed to help developers build AI-powered applications.
  • Main sections: Prerequisites, Set Up Your Application, Create an API route, Choosing a Provider, Using other providers.

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/getting-started/svelte