Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/ai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ai@3.0.8
Choose a base ref
...
head repository: vercel/ai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ai@3.0.9
Choose a head ref
  • 3 commits
  • 21 files changed
  • 4 contributors

Commits on Mar 11, 2024

  1. Update README.md

    jaredpalmer authored Mar 11, 2024
    Copy the full SHA
    fce8b10 View commit details
  2. fix(ai/rsc): Improve streamable .done() types (#1132)

    shuding authored Mar 11, 2024
    Copy the full SHA
    81ca3d6 View commit details
  3. Version Packages (#1133)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 11, 2024
    Copy the full SHA
    b32dcd4 View commit details
2 changes: 1 addition & 1 deletion examples/next-anthropic/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@anthropic-ai/sdk": "0.15.0",
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "^18.2.0"
2 changes: 1 addition & 1 deletion examples/next-aws-bedrock/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "3.451.0",
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "^18.2.0"
2 changes: 1 addition & 1 deletion examples/next-fireworks/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"openai": "4.16.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-google-generative-ai/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@google/generative-ai": "0.1.1",
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "^18.2.0"
2 changes: 1 addition & 1 deletion examples/next-huggingface/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"@huggingface/inference": "^2.5.1",
"next": "14.1.1",
"ai": "3.0.8",
"ai": "3.0.9",
"react": "18.2.0",
"react-dom": "^18.2.0"
},
2 changes: 1 addition & 1 deletion examples/next-inkeep/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"dependencies": {
"@inkeep/ai-api": "^0.1.8",
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "^18.2.0"
2 changes: 1 addition & 1 deletion examples/next-langchain/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"langchain": "^0.0.196",
"next": "14.1.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-mistral/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"@mistralai/mistralai": "0.1.3",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-openai-pages/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"openai": "4.16.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-openai-rate-limits/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"dependencies": {
"@upstash/ratelimit": "^0.4.3",
"@vercel/kv": "^0.2.2",
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"openai": "4.16.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-openai/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"openai": "4.16.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/next-perplexity/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"ai": "3.0.8",
"ai": "3.0.9",
"next": "14.1.1",
"openai": "4.16.1",
"react": "18.2.0",
2 changes: 1 addition & 1 deletion examples/nuxt-openai/package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"@vue/runtime-core": "^3.3.4",
"@vue/runtime-dom": "^3.3.4",
"@vue/shared": "^3.3.4",
"ai": "3.0.8",
"ai": "3.0.9",
"nuxt": "^3.6.5",
"openai": "4.16.1",
"tailwindcss": "^3.3.3",
2 changes: 1 addition & 1 deletion examples/solidstart-openai/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"dependencies": {
"@solidjs/meta": "0.29.3",
"@solidjs/router": "0.8.2",
"ai": "3.0.8",
"ai": "3.0.9",
"openai": "4.16.1",
"solid-js": "1.8.7",
"solid-start": "0.3.10",
2 changes: 1 addition & 1 deletion examples/sveltekit-openai/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"dependencies": {
"openai": "4.16.1",
"ai": "3.0.8"
"ai": "3.0.9"
},
"devDependencies": {
"@fontsource/fira-mono": "^4.5.10",
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ai

## 3.0.9

### Patch Changes

- 81ca3d6: fix(ai/rsc): improve .done() argument type

## 3.0.8

### Patch Changes
14 changes: 10 additions & 4 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@ The Vercel AI SDK is **a library for building AI-powered streaming text and chat

## Features

- React Server Components API for streaming Generative UI
- [SWR](https://swr.vercel.app)-powered React, Svelte, Vue and Solid helpers for streaming text responses and building chat and completion UIs
- First-class support for [LangChain](https://js.langchain.com/docs) and [OpenAI](https://openai.com), [Anthropic](https://www.anthropic.com), [Cohere](https://cohere.com), [Hugging Face](https://huggingface.co), [Fireworks](https://app.fireworks.ai) and [Replicate](https://replicate.com)
- React, Svelte, Vue and Solid helpers for streaming text responses and building chat and completion UIs
- React Server Components API for streaming [Generative UI](https://vercel.com/blog/ai-sdk-3-generative-ui)
- First-class support for [OpenAI](https://openai.com), [Anthropic](https://www.anthropic.com), [Mistral](https://mistral.ai), [Perplexity](https://perplexity.ai), [AWS Bedrock](https://aws.amazon.com/bedrock/), [Azure](https://ai.azure.com), [Google Gemini](https://ai.google.dev), [Hugging Face](https://huggingface.co), [Fireworks](https://app.fireworks.ai), [Cohere](https://cohere.com), [LangChain](https://js.langchain.com/docs), [Replicate](https://replicate.com), Ollama, and more.
- Node.js, Serverless, and [Edge Runtime](https://edge-runtime.vercel.app/) support
- Callbacks for saving completed streaming responses to a database (in the same request)
- Lifecycle callbacks for saving completed streaming responses to a database (in the same request)

## Installation

@@ -29,3 +29,9 @@ This library is created by [Vercel](https://vercel.com) and [Next.js](https://ne
- Justin Ridgewell ([@jridgewell](https://github.com/jridgewell)) - [Vercel](https://vercel.com)

[Contributors](https://github.com/vercel/ai/graphs/contributors)

## Related: Deploy your own Next.js AI Chatbot

If you're looking to for a full AI Chatbot application to jumpstart your AI journey, you should checkout [our sister OSS AI Chatbot project](https://github.com/vercel/ai-chatbot) or click the button below to deploy your own to [Vercel](https://vercel.com).

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/templates/Next.js/nextjs-ai-chatbot)
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ai",
"version": "3.0.8",
"version": "3.0.9",
"license": "Apache-2.0",
"sideEffects": false,
"main": "./dist/index.js",
3 changes: 3 additions & 0 deletions packages/core/rsc/index.ts
Original file line number Diff line number Diff line change
@@ -6,10 +6,13 @@ export type {
render,
createAI,
} from './rsc-server';

export type {
readStreamableValue,
useUIState,
useAIState,
useActions,
useSyncUIState,
} from './rsc-client';

export type { StreamableValue } from './types';
4 changes: 2 additions & 2 deletions packages/core/rsc/streamable.tsx
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ export function createStreamableUI(initialValue?: React.ReactNode) {
closed = true;
reject(error);
},
done(...args: any) {
done(...args: [] | [React.ReactNode]) {
assertStream('.done()');

if (warningTimeout) {
@@ -187,7 +187,7 @@ export function createStreamableValue<T = any, E = any>(initialValue?: T) {

resolvable.resolve({ error });
},
done(...args: any) {
done(...args: [] | [T]) {
assertStream('.done()');

if (warningTimeout) {
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.