‹ 返回总目录
工具 最近更新08-02

ai-sdk

| 2026-08-01 收录

☆ 收藏
🛒 📚 AI提效实战指南 · 图解Skill🛒 📱 大流量手机卡 · 低月租📣 加入推广 · 佣金80-300/张 ›

🛍️ 更多精选好物 ›

📊 公开数据一览

📦 榜单安装量44.7K
⭐ GitHub Stars25,973(fork 4900)
🗓️ 最近推送2026-08-02
🌱 项目创建2023-05-23
💻 语言 / LicenseTypeScript · NOASSERTION
🐛 开放Issue1722

📝 工具简介

TypeScript的AI工具包,来自Next.js团队,免费开源的AI应用和代理构建库。

📖 怎么用

先确保 Node.js 22+ 和 npm 装好,然后运行 `npm install ai` 安装核心包。想用具体模型,再装对应 provider,比如 `npm install @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google`。给 AI 编码助手用的话,在项目里跑 `npx skills add vercel/ai` 添加技能。代码里这样用:`import { anthropic } from '@ai-sdk/anthropic'; const result = await generateText({ model: anthropic('claude-opus-4-6'), prompt: 'Hello!' });`。

📋 迷你测评

Next.js团队出品的TypeScript AI工具包,免费开源,用于构建AI应用和代理。亮点是官方背书,生态兼容性好。简介未提版本或下载量,适合TypeScript开发者直接引入。

⚠️ 避坑记录

📄 README 要点

这是一个与框架无关的TypeScript工具包,专门用来构建AI应用和智能体,支持Next.js、React、Svelte、Vue、Angular等主流框架,以及Node.js运行时。需要Node.js 22+环境,通过npm安装。它提供统一的API接口,可以对接OpenAI、Anthropic、Google等主流模型提供商,默认通过Vercel AI Gateway访问所有主流模型,只需传入模型字符串即可。还附带一个给Claude Code或Cursor用的技能包,推荐装到项目里。适合想快速搭建AI应用、又不想被特定云厂商绑定的开发者。

查看英文原文
AI SDK The AI SDK is a provider agnostic TypeScript toolkit designed to help you build AI powered applications and agents using popular UI frameworks like Next.js, React, Svelte, Vue, Angular, and runtimes like Node.js. To learn more about how to use the AI SDK, check out our API Reference and Documentation. Installation You will need Node.js 22+ and npm (or another package manager) installed on your local development machine. [安装/使用命令见下方] Skill for Coding Agents If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository: [安装/使用命令见下方] Unified Provider Architecture The AI SDK provides a unified API to interact with model providers like OpenAI, Anthropic, Google, and more. By default, the AI SDK uses the Vercel AI Gateway to give you access to all major providers out of the box. Just pass a model string for any supported model: [安装/使用命令见下方] You can also connect to providers directly using their SDK packages: [安装/使用命令见下方] [安装/使用命令见下方] Usage Generating Text [安装/使用命令见下方] Generating Structured Data [安装/使用命令见下方] Agents [安装/使用命令见下方] UI Integration The AI SDK UI module provides a set of hooks that help you build chatbots and generative user interfaces. These hooks are framework agnostic, so they can be used in Next.js, React, Svelte, and Vue. You need to install the package for your framework, e.g.: [安装/使用命令见下方] Agent @/agent/image generation agent.ts [安装/使用命令见下方] Route (Next.js App Router) @/app/api/chat/route.ts [安装/使用命令见下方] UI Component for Tool @/component/image generation view.tsx [安装/使用命令见下方] Page @/app/page.tsx [安装/使用命令见下方] Templates We've built templates that include AI SDK integrations for different use cases, providers, and frameworks. You can use these templates to get started with your AI powered application. Community The AI SDK community can be found on the Vercel Community where you can ask questions, voice ideas, and share your projects with other people. Contributing Contributions to the AI SDK are

💬 评论(0)

交流使用体验、避坑建议;违规内容将被删除

💬 意见反馈 / 联系客服

数据来源:skills.sh 榜单 + GitHub 公开数据,非人工实测,仅供参考