Skip to content

Commit

Permalink
chore (docs): change naming to AI SDK (#3051)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored Sep 18, 2024
1 parent 0e568f4 commit b22b7ea
Show file tree
Hide file tree
Showing 157 changed files with 392 additions and 394 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to the Vercel AI SDK
# Contributing to the AI SDK

We deeply appreciate your interest in contributing to our repository! Whether you're reporting bugs, suggesting enhancements, improving docs, or submitting pull requests, your contributions help improve the project for everyone.

Expand Down
4 changes: 2 additions & 2 deletions content/docs/01-introduction/index.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: AI SDK by Vercel
description: Welcome to the Vercel AI SDK documentation!
description: Welcome to the AI SDK documentation!
---

# AI SDK

The Vercel AI SDK is the TypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js, and more.
The AI SDK is the TypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js, and more.

## Why use the AI SDK?

Expand Down
15 changes: 7 additions & 8 deletions content/docs/02-foundations/01-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
title: Overview
description: An overview of foundational concepts critical to understanding the Vercel AI SDK
description: An overview of foundational concepts critical to understanding the AI SDK
---

# Overview

<Note>
This page is a beginner-friendly introduction to high-level artificial
intelligence (AI) concepts. To dive right into implementing the Vercel AI SDK,
feel free to skip ahead to our [quickstarts](/docs/getting-started) or learn
about our [supported models and
providers](/docs/foundations/providers-and-models).
intelligence (AI) concepts. To dive right into implementing the AI SDK, feel
free to skip ahead to our [quickstarts](/docs/getting-started) or learn about
our [supported models and providers](/docs/foundations/providers-and-models).
</Note>

The Vercel AI SDK standardizes integrating artificial intelligence (AI) models across [supported providers](/docs/foundations/providers-and-models). This enables developers to focus on building great AI applications, not waste time on technical details.
The AI SDK standardizes integrating artificial intelligence (AI) models across [supported providers](/docs/foundations/providers-and-models). This enables developers to focus on building great AI applications, not waste time on technical details.

For example, here’s how you can generate text with various models using the Vercel AI SDK:
For example, here’s how you can generate text with various models using the AI SDK:

<PreviewSwitchProviders />

Expand All @@ -41,4 +40,4 @@ However, it's crucial to understand LLMs' limitations. When asked about less kno

An **embedding model** is used to convert complex data (like words or images) into a dense vector (a list of numbers) representation, known as an embedding. Unlike generative models, embedding models do not generate new text or data. Instead, they provide representations of semantic and synactic relationships between entities that can be used as input for other models or other natural language processing tasks.

In the next section, you will learn about the difference between models providers and models, and which ones are available in the Vercel AI SDK.
In the next section, you will learn about the difference between models providers and models, and which ones are available in the AI SDK.
6 changes: 3 additions & 3 deletions content/docs/02-foundations/02-providers-and-models.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Providers and Models
description: Learn about the providers and models available in the Vercel AI SDK.
description: Learn about the providers and models available in the AI SDK.
---

# Providers and Models
Expand All @@ -9,7 +9,7 @@ Companies such as OpenAI and Anthropic (providers) offer access to a range of la

Each provider typically has its own unique method for interfacing with their models, complicating the process of switching providers and increasing the risk of vendor lock-in.

To solve these challenges, Vercel AI SDK Core offers a standardized approach to interacting with LLMs through a [language model specification](https://github.com/vercel/ai/tree/main/packages/provider/src/language-model/v1) that abstracts differences between providers. This unified interface allows you to switch between providers with ease while using the same API for all providers.
To solve these challenges, AI SDK Core offers a standardized approach to interacting with LLMs through a [language model specification](https://github.com/vercel/ai/tree/main/packages/provider/src/language-model/v1) that abstracts differences between providers. This unified interface allows you to switch between providers with ease while using the same API for all providers.

Here is an overview of the AI SDK Provider Architecture:

Expand All @@ -22,7 +22,7 @@ Here is an overview of the AI SDK Provider Architecture:

## AI SDK Providers

Vercel AI SDK comes with several providers that you can use to interact with different language models:
The AI SDK comes with several providers that you can use to interact with different language models:

- [OpenAI Provider](/providers/ai-sdk-providers/openai) (`@ai-sdk/openai`)
- [Azure OpenAI Provider](/providers/ai-sdk-providers/azure) (`@ai-sdk/azure`)
Expand Down
4 changes: 2 additions & 2 deletions content/docs/02-foundations/03-prompts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Prompts
description: Learn about the Prompt structure used in the Vercel AI SDK.
description: Learn about the Prompt structure used in the AI SDK.
---

# Prompts
Expand All @@ -11,7 +11,7 @@ It's like when you ask someone for directions; the clearer your question, the be
Many LLM providers offer complex interfaces for specifying prompts. They involve different roles and message types.
While these interfaces are powerful, they can be hard to use and understand.

In order to simplify prompting across compatible providers, the Vercel AI SDK offers two categories of prompts: text prompts and message prompts.
In order to simplify prompting across compatible providers, the AI SDK offers two categories of prompts: text prompts and message prompts.

## Text Prompts

Expand Down
6 changes: 3 additions & 3 deletions content/docs/02-foundations/04-tools.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Tools
description: Learn about tools with the Vercel AI SDK.
description: Learn about tools with the AI SDK.
---

# Tools
Expand Down Expand Up @@ -94,8 +94,8 @@ There are several providers that offer pre-built tools as **toolkits** that you

<Note>
Do you have open source tools or tool libraries that are compatible with the
Vercel AI SDK? Please [file a pull
request](https://github.com/vercel/ai/pulls) to add them to this list.
AI SDK? Please [file a pull request](https://github.com/vercel/ai/pulls) to
add them to this list.
</Note>

## Learn more
Expand Down
2 changes: 1 addition & 1 deletion content/docs/02-foundations/05-streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ As you can see, the streaming UI is able to start displaying the response much f

While streaming interfaces can greatly enhance user experiences, especially with larger language models, they aren't always necessary or beneficial. If you can achieve your desired functionality using a smaller, faster model without resorting to streaming, this route can often lead to simpler and more manageable development processes.

However, regardless of the speed of your model, the Vercel AI SDK is designed to make implementing streaming UIs as simple as possible. In the example below, we stream text generation from OpenAI's `gpt-4-turbo` in under 10 lines of code using the SDK's [`streamText`](/docs/reference/ai-sdk-core/stream-text) function:
However, regardless of the speed of your model, the AI SDK is designed to make implementing streaming UIs as simple as possible. In the example below, we stream text generation from OpenAI's `gpt-4-turbo` in under 10 lines of code using the SDK's [`streamText`](/docs/reference/ai-sdk-core/stream-text) function:

```ts
import { openai } from '@ai-sdk/openai';
Expand Down
8 changes: 4 additions & 4 deletions content/docs/02-foundations/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Foundations
description: A section that covers foundational knowledge around LLMs and concepts crucial to the Vercel AI SDK
description: A section that covers foundational knowledge around LLMs and concepts crucial to the AI SDK
---

# Foundations
Expand All @@ -15,18 +15,18 @@ description: A section that covers foundational knowledge around LLMs and concep
{
title: 'Providers and Models',
description:
'Learn about the providers and models that you can use with the Vercel AI SDK.',
'Learn about the providers and models that you can use with the AI SDK.',
href: '/docs/foundations/providers-and-models',
},
{
title: 'Prompts',
description:
'Learn about how Prompts are used and defined in the Vercel AI SDK.',
'Learn about how Prompts are used and defined in the AI SDK.',
href: '/docs/foundations/prompts',
},
{
title: 'Tools',
description: 'Learn about tools in the Vercel AI SDK.',
description: 'Learn about tools in the AI SDK.',
href: '/docs/foundations/tools',
},
{
Expand Down
8 changes: 4 additions & 4 deletions content/docs/02-getting-started/01-navigating-the-library.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
title: Navigating the Library
description: Learn how to navigate the Vercel AI SDK.
description: Learn how to navigate the AI SDK.
---

# Navigating the Library

The Vercel AI SDK is a powerful toolkit for building AI applications. This page will help you pick the right tools for your requirements.
the AI SDK is a powerful toolkit for building AI applications. This page will help you pick the right tools for your requirements.

Let’s start with a quick overview of the Vercel AI SDK, which is comprised of three parts:
Let’s start with a quick overview of the AI SDK, which is comprised of three parts:

- **[AI SDK Core](/docs/ai-sdk-core/overview):** A unified API for generating text, structured objects, and tool calls with LLMs.
- **[AI SDK UI](/docs/ai-sdk-ui/overview):** A set of framework-agnostic hooks for quickly building chat and generative user interface.
- **[AI SDK RSC](/docs/ai-sdk-rsc/overview):** A library to stream generative user interfaces with React Server Components (RSC).

## Choosing the Right Tool for Your Environment

When deciding which part of the Vercel AI SDK to use, your first consideration should be the environment and existing stack you are working with. Different components of the SDK are tailored to specific frameworks and environments.
When deciding which part of the AI SDK to use, your first consideration should be the environment and existing stack you are working with. Different components of the SDK are tailored to specific frameworks and environments.

| Library | Purpose | Environment Compatibility |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
Expand Down
18 changes: 9 additions & 9 deletions content/docs/02-getting-started/02-nextjs-app-router.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Next.js App Router
description: Welcome to the Vercel AI SDK documentation!
description: Welcome to the AI SDK documentation!
---

# Next.js App Router Quickstart
Expand Down Expand Up @@ -38,10 +38,10 @@ Navigate to the newly created directory:

### Install dependencies

Install `ai` and `@ai-sdk/openai`, the Vercel AI package and Vercel AI SDK's [ OpenAI provider ](/providers/ai-sdk-providers/openai) respectively.
Install `ai` and `@ai-sdk/openai`, the AI package and AI SDK's [ OpenAI provider ](/providers/ai-sdk-providers/openai) respectively.

<Note>
Vercel AI SDK is designed to be a unified interface to interact with any large
The AI SDK is designed to be a unified interface to interact with any large
language model. This means that you can change model and providers with just
one line of code! Learn more about [available providers](/providers) and
[building custom providers](/providers/community-providers/custom-providers)
Expand Down Expand Up @@ -80,7 +80,7 @@ OPENAI_API_KEY=xxxxxxxxx
Replace `xxxxxxxxx` with your actual OpenAI API key.

<Note className="mb-4">
Vercel AI SDK's OpenAI Provider will default to using the `OPENAI_API_KEY`
The AI SDK's OpenAI Provider will default to using the `OPENAI_API_KEY`
environment variable.
</Note>

Expand Down Expand Up @@ -118,7 +118,7 @@ This Route Handler creates a POST request endpoint at `/api/chat`.

## Wire up the UI

Now that you have a Route Handler that can query an LLM, it's time to setup your frontend. Vercel AI SDK's [ UI ](/docs/ai-sdk-ui) package abstracts the complexity of a chat interface into one hook, [`useChat`](/docs/reference/ai-sdk-ui/use-chat).
Now that you have a Route Handler that can query an LLM, it's time to setup your frontend. The AI SDK's [ UI ](/docs/ai-sdk-ui) package abstracts the complexity of a chat interface into one hook, [`useChat`](/docs/reference/ai-sdk-ui/use-chat).

Update your root page (`app/page.tsx`) with the following code to show a list of chat messages and provide a user message input:

Expand Down Expand Up @@ -169,7 +169,7 @@ With that, you have built everything you need for your chatbot! To start your ap

<Snippet text="pnpm run dev" />

Head to your browser and open http://localhost:3000. You should see an input field. Test it out by entering a message and see the AI chatbot respond in real-time! Vercel AI SDK makes it fast and easy to build AI chat interfaces with Next.js.
Head to your browser and open http://localhost:3000. You should see an input field. Test it out by entering a message and see the AI chatbot respond in real-time! The AI SDK makes it fast and easy to build AI chat interfaces with Next.js.

## Stream Data Alongside Response

Expand Down Expand Up @@ -249,9 +249,9 @@ Head back to your browser (http://localhost:3000) and enter a new message. You s

## Introducing more granular control with `ai/rsc`

So far, you have used Vercel AI SDK's [ UI ](/docs/ai-sdk-ui) package to connect your frontend to your API route. This package is framework agnostic and provides simple abstractions for quickly building chat-like interfaces with LLMs.
So far, you have used the AI SDK's [ UI ](/docs/ai-sdk-ui) package to connect your frontend to your API route. This package is framework agnostic and provides simple abstractions for quickly building chat-like interfaces with LLMs.

The Vercel AI SDK also has a package ([`ai/rsc`](/docs/ai-sdk-rsc)) specifically designed for frameworks that support the [React Server Component](https://nextjs.org/docs/app/building-your-application/rendering/server-components) architecture. With `ai/rsc`, you can build AI applications that go beyond pure text.
The AI SDK also has a package ([`ai/rsc`](/docs/ai-sdk-rsc)) specifically designed for frameworks that support the [React Server Component](https://nextjs.org/docs/app/building-your-application/rendering/server-components) architecture. With `ai/rsc`, you can build AI applications that go beyond pure text.

## Next.js App Router

Expand Down Expand Up @@ -469,6 +469,6 @@ The `ai/rsc` library is designed to give you complete control over streamable va

## Where to Next?

You've built an AI chatbot using the Vercel AI SDK! Experiment and extend the functionality of this application further by exploring [tool calling](/docs/ai-sdk-core/tools-and-tool-calling) or introducing more granular control over [AI and UI states](/docs/ai-sdk-rsc/generative-ui-state).
You've built an AI chatbot using the AI SDK! Experiment and extend the functionality of this application further by exploring [tool calling](/docs/ai-sdk-core/tools-and-tool-calling) or introducing more granular control over [AI and UI states](/docs/ai-sdk-rsc/generative-ui-state).

If you are looking to leverage the broader capabilities of LLMs, Vercel [ AI SDK Core ](/docs/ai-sdk-core) provides a comprehensive set of lower-level tools and APIs that will help you unlock a wider range of AI functionalities beyond the chatbot paradigm.
16 changes: 8 additions & 8 deletions content/docs/02-getting-started/03-nextjs-pages-router.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Next.js Pages Router
description: Welcome to the Vercel AI SDK documentation!
description: Welcome to the AI SDK documentation!
---

# Next.js Pages Router Quickstart

The Vercel AI SDK is a powerful Typescript library designed to help developers build AI-powered applications.
The AI SDK is a powerful Typescript library designed to help developers build AI-powered applications.

In this quickstart tutorial, you'll build a simple AI-chatbot with a streaming user interface. Along the way, you'll learn key concepts and techniques that are fundamental to using the SDK in your own projects.

Expand Down Expand Up @@ -38,10 +38,10 @@ Navigate to the newly created directory:

### Install dependencies

Install `ai` and `@ai-sdk/openai`, Vercel AI SDK's OpenAI provider.
Install `ai` and `@ai-sdk/openai`, the AI SDK's OpenAI provider.

<Note>
Vercel AI SDK is designed to be a unified interface to interact with any large
The AI SDK is designed to be a unified interface to interact with any large
language model. This means that you can change model and providers with just
one line of code! Learn more about [available providers](/providers) and
[building custom providers](/providers/community-providers/custom-providers)
Expand Down Expand Up @@ -80,7 +80,7 @@ OPENAI_API_KEY=xxxxxxxxx
Replace `xxxxxxxxx` with your actual OpenAI API key.

<Note className="mb-4">
Vercel AI SDK's OpenAI Provider will default to using the `OPENAI_API_KEY`
The AI SDK's OpenAI Provider will default to using the `OPENAI_API_KEY`
environment variable.
</Note>

Expand Down Expand Up @@ -124,7 +124,7 @@ This Route Handler creates a POST request endpint at `/api/chat`.

## Wire up the UI

Now that you have an API route that can query an LLM, it's time to setup your frontend. Vercel AI SDK's [ UI ](/docs/ai-sdk-ui) package abstract the complexity of a chat interface into one hook, [`useChat`](/docs/reference/ai-sdk-ui/use-chat).
Now that you have an API route that can query an LLM, it's time to setup your frontend. The AI SDK's [ UI ](/docs/ai-sdk-ui) package abstract the complexity of a chat interface into one hook, [`useChat`](/docs/reference/ai-sdk-ui/use-chat).

Update your root page (`pages/index.tsx`) with the following code to show a list of chat messages and provide a user message input:

Expand Down Expand Up @@ -168,7 +168,7 @@ With that, you have built everything you need for your chatbot! To start your ap

<Snippet text="pnpm run dev" />

Head to your browser and open http://localhost:3000. You should see an input field. Test it out by entering a message and see the AI chatbot respond in real-time! Vercel AI SDK makes it fast and easy to build AI chat interfaces with Next.js.
Head to your browser and open http://localhost:3000. You should see an input field. Test it out by entering a message and see the AI chatbot respond in real-time! The AI SDK makes it fast and easy to build AI chat interfaces with Next.js.

## Stream Data Alongside Response

Expand Down Expand Up @@ -246,6 +246,6 @@ Head back to your browser (http://localhost:3000) and enter a new message. You s

## Where to Next?

You've built an AI chatbot using the Vercel AI SDK! Experiment and extend the functionality of this application further by exploring [tool calling](/docs/ai-sdk-ui/chatbot-with-tool-calling) or [persisting chat history](/docs/ai-sdk-ui/storing-messages).
You've built an AI chatbot using the AI SDK! Experiment and extend the functionality of this application further by exploring [tool calling](/docs/ai-sdk-ui/chatbot-with-tool-calling) or [persisting chat history](/docs/ai-sdk-ui/storing-messages).

If you are looking to leverage the broader capabilities of LLMs, Vercel [ AI SDK Core ](/docs/ai-sdk-core) provides a comprehensive set of lower-level tools and APIs that will help you unlock a wider range of AI functionalities beyond the chatbot paradigm.
Loading

0 comments on commit b22b7ea

Please sign in to comment.