Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ydc-ai-sdk-integration或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ydc-ai-sdk-integration⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ydc-ai-sdk-integration/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: ydc-ai-sdk-integration description: Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK. license: MIT compatibility: Requires Node.js 18+ and npm/bun/yarn/pnpm metadata: author: youdotcom-oss category: sdk-integration version: "1.0.0" keywords: vercel,vercel-ai-sdk,ai-sdk,you.com,integration,anthropic,openai,web-search,content-extraction,livecrawl,citations ---
Interactive workflow to add You.com tools to your Vercel AI SDK application using @youdotcom-oss/ai-sdk-plugin.
* Which package manager? (npm, bun, yarn, pnpm) * Install package using their choice: ```bash npm install @youdotcom-oss/ai-sdk-plugin # or bun add @youdotcom-oss/ai-sdk-plugin # or yarn add @youdotcom-oss/ai-sdk-plugin # or pnpm add @youdotcom-oss/ai-sdk-plugin ```
* Using standard YDC_API_KEY? * Or custom name? (if custom, get the name) * Have they set it in their environment? * If NO: Guide them to get key from https://you.com/platform/api-keys
* Do they use generateText()? * Do they use streamText()? * Both?
* EXISTING: Ask which file(s) to edit * NEW: Ask where to create file(s) and what to name them
* Which tools to add? - youSearch (web search) - youExpress (AI agent) - youContents (content extraction) - Multiple? (which combination?) * Using generateText() or streamText() in this file? * Which AI provider model? (to determine if stopWhen needed)
See "Integration Examples" section below for complete code patterns: * generateText() - Basic text generation with tools * streamText() - Streaming responses with web frameworks (Next.js, Express, React)
For each file: * Reference integration examples (generateText or streamText based on their answer) * Add import for selected tools * If EXISTING file: Find their generateText/streamText call and add tools object * If NEW file: Create file with example structure * Tool invocation pattern based on env var name: - Standard YDC_API_KEY: youSearch() - Custom name: youSearch({ apiKey: process.env.CUSTOM_NAME }) * Add selected tools to tools object * If streamText + Anthropic: Add stopWhen parameter
Environment Variables Setup:
import { anthropic } from '@ai-sdk/anthropic';
import { generateText } from 'ai';
import { youContents, youExpress, youSearch } from '@youdotcom-oss/ai-sdk-plugin';
// Reads YDC_API_KEY from environment automatically
const result = await generateText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: {
search: youSearch(),
},
prompt: 'What are the latest developments in quantum computing?',
});
console.log(result.text);
Multiple Tools:
const result = await generateText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: {
search: youSearch(), // Web search with citations
agent: youExpress(), // AI answers with web context
extract: youContents(), // Content extraction from URLs
},
prompt: 'Research quantum computing and summarize the key papers',
});
Custom API Key:
const result = await generateText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: {
search: youSearch({ apiKey: 'your-custom-key' }),
},
prompt: 'Your prompt here',
});
Complete Example:
import { anthropic } from '@ai-sdk/anthropic';
import { generateText } from 'ai';
import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
const main = async () => {
try {
const result = await generateText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: {
search: youSearch(),
},
maxSteps: 5,
prompt: 'What are the latest developments in quantum computing?',
});
console.log('Generated text:', result.text);
console.log('\nTool calls:', result.steps.flatMap(s => s.toolCalls));
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
};
main();
Basic Streaming with stopWhen Pattern:
import { anthropic } from '@ai-sdk/anthropic';
import { streamText, type StepResult } from 'ai';
import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
// CRITICAL: Always use stopWhen for Anthropic streaming
// Anthropic's SDK requires explicit stop conditions
const stepCountIs = (n: number) => (stepResult: StepResult<any>) =>
stepResult.stepNumber >= n;
const result = streamText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: { search: youSearch() },
stopWhen: stepCountIs(3), // Required for Anthropic
prompt: 'What are the latest AI developments?',
});
// Consume stream
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
Next.js Integration (App Router):
// app/api/chat/route.ts
import { anthropic } from '@ai-sdk/anthropic';
import { streamText, type StepResult } from 'ai';
import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
const stepCountIs = (n: number) => (stepResult: StepResult<any>) =>
stepResult.stepNumber >= n;
export async function POST(req: Request) {
const { prompt } = await req.json();
const result = streamText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: { search: youSearch() },
stopWhen: stepCountIs(5),
prompt,
});
return result.toDataStreamResponse();
}
Express.js Integration:
// server.ts
import express from 'express';
import { anthropic } from '@ai-sdk/anthropic';
import { streamText, type StepResult } from 'ai';
import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
const app = express();
app.use(express.json());
const stepCountIs = (n: number) => (stepResult: StepResult<any>) =>
stepResult.stepNumber >= n;
app.post('/api/chat', async (req, res) => {
const { prompt } = req.body;
const result = streamText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: { search: youSearch() },
stopWhen: stepCountIs(5),
prompt,
});
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
res.setHeader('Transfer-Encoding', 'chunked');
for await (const chunk of result.textStream) {
res.write(chunk);
}
res.end();
});
app.listen(3000);
React Client (with Next.js):
// components/Chat.tsx
'use client';
import { useChat } from 'ai/react';
export default function Chat() {
const { messages, input, handleInputChange, handleSubmit } = useChat({
api: '/api/chat',
});
return (
<div>
{messages.map(m => (
<div key={m.id}>
<strong>{m.role}:</strong> {m.content}
</div>
))}
<form onSubmit={handleSubmit}>
<input value={input} onChange={handleInputChange} />
<button type="submit">Send</button>
</form>
</div>
);
}
Complete Streaming Example:
import { anthropic } from '@ai-sdk/anthropic';
import { streamText, type StepResult } from 'ai';
import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
const stepCountIs = (n: number) => (stepResult: StepResult<any>) =>
stepResult.stepNumber >= n;
const main = async () => {
try {
const result = streamText({
model: anthropic('claude-sonnet-4-5-20250929'),
tools: {
search: youSearch(),
},
stopWhen: stepCountIs(3),
prompt: 'What are the latest AI developments?',
});
...安装 Integrate You.com web tools with Vercel AI SDK 后,可以对 AI 说这些话来触发它
Help me get started with Integrate You.com web tools with Vercel AI SDK
Explains what Integrate You.com web tools with Vercel AI SDK does, walks through the setup, and runs a quick demo based on your current project
Use Integrate You.com web tools with Vercel AI SDK to integrate Vercel AI SDK applications with You
Invokes Integrate You.com web tools with Vercel AI SDK with the right parameters and returns the result directly in the conversation
What can I do with Integrate You.com web tools with Vercel AI SDK in my developer & devops workflow?
将技能文件夹放到 ~/.claude/skills/ydc-ai-sdk-integration/ 目录(个人级,所有项目可用),或 .claude/skills/ydc-ai-sdk-integration/(项目级)。重启 AI 客户端后,用 /ydc-ai-sdk-integration 主动调用,或让 AI 根据上下文自动发现并使用。
Integrate You.com web tools with Vercel AI SDK 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Integrate You.com web tools with Vercel AI SDK 可免费安装使用。请查阅仓库了解许可证信息。
Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK.
Lists the top use cases for Integrate You.com web tools with Vercel AI SDK, with example commands for each scenario
Automate my developer & devops tasks using Integrate You.com web tools with Vercel AI SDK
Identifies repetitive steps in your workflow and sets up Integrate You.com web tools with Vercel AI SDK to handle them automatically
Integrate You.com web tools with Vercel AI SDK 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。