[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EJJF0VBK0XD547A1XYCE1P":3,"skill-same:01M6EJJF0VBK0XD547A1XYCE1P":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EJJF0VBK0XD547A1XYCE1P","ai-sdk-handler",null,"Integrate Vercel AI SDK for LLMs, Chatbots, Generative UI, and Agentic Workflows.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"sdk","ai sdk","ai sdk handler","agentic","llms","workflows","auth","agentic workflows","ui","inngest","vercel","integrate","vercel ai sdk","chatbots","2026-11-10 10:12:30",false,"---\nname: ai-sdk-handler\ndescription: Integrate Vercel AI SDK for LLMs, Chatbots, Generative UI, and Agentic Workflows.\ndeps: [\"auth-handler\", \"inngest-handler\"]\n---\n\n# AI SDK Handler\n\nThis skill defines how to implement Large Language Model (LLM) features using the Vercel AI SDK. It covers streaming chat, structured object generation, generative UI, and background agents.\n\n**Note**: For Image\u002FVideo generation (Replicate, Fal.ai), continue to use `ai-handler`. Use `ai-sdk-handler` specifically for text, chat, and agentic text\u002FJSON workflows.\n\n## When to Use\n- **Chatbots**: Building interactive chat interfaces (`useChat`, `streamText`).\n- **Structured Data**: Extracting JSON from text (`generateObject`).\n- **Generative UI**: Streaming React components directly from the server (`streamUI`).\n- **Agents**: Complex, multi-step reasoning tasks (often combined with Inngest).\n- **Multimodal**: Handling image inputs with text.\n\n## Capabilities\n\n### 1. Streaming Chat\n- **Tool**: `streamText` (Server), `useChat` (Client).\n- **Pattern**: Create a route handler at `src\u002Fapp\u002Fapi\u002Fchat\u002Froute.ts`.\n- **Auth**: Wrap with `withAuthRequired` to protect the route.\n- **UI**: Use `src\u002Fcomponents\u002Fchat-ui\u002F` for chat components.\n\n### 2. Generative UI (RSC)\n- **Tool**: `streamUI` (Server).\n- **Pattern**: Return React components based on tool calls.\n- **Use Case**: Dashboards that build themselves, dynamic reports.\n\n### 3. Structured Object Generation\n- **Tool**: `generateObject`.\n- **Pattern**: Define a Zod schema and get strictly typed JSON back.\n- **Use Case**: Populating database forms, extracting itinerary details, categorizing content.\n\n### 4. Background Agents (with Inngest)\n- **Tool**: `generateText` \u002F `generateObject` inside Inngest steps.\n- **Why**: Next.js Server Actions\u002FRoutes have timeouts (max 60s usually). Agents taking longer must run in the background.\n- **Pattern**:\n    1. Trigger Inngest event from UI.\n    2. Inngest function runs the LLM logic (loops, multi-step).\n    3. Store result in DB or notify user.\n    4. **Docs**: [AI SDK Agents](https:\u002F\u002Fai-sdk.dev\u002Fdocs\u002Fagents\u002Foverview).\n\n## Best Practices\n\n1.  **Streaming**: Always prefer streaming for text generation > 2 seconds to improve perceived latency.\n2.  **Auth**: Never expose open AI routes. Always verify `session.user.id`.\n3.  **Providers**: Use `@ai-sdk\u002Fopenai` or `@ai-sdk\u002Fanthropic`. Abstract the provider configuration in `src\u002Flib\u002Fai\u002Findex.ts`.\n4.  **Backpressure**: The AI SDK handles this automatically in `streamText`.\n5.  **Caching**: Use `unstable_cache` or KV stores if queries are repetitive.\n6.  **Prompt Engineering**: Keep prompts in a dedicated folder or constant file if they are complex.\n\n## Documentation & Examples\n\n-   **`reference.md`**: Core setup and essential code snippets.\n-   **`examples.md`**: Exhaustive examples covering:\n    1.  Basic Chat\n    2.  Generative UI\n    3.  Structured Object Generation\n    4.  Agents & Workflows (Loop Control)\n    5.  Caching\n    6.  Streaming Data\n    7.  Reading UI Streams\n    8.  Handling Backpressure\n    9.  Multimodal Chat\n","# AI SDK Handler\n\nThis skill defines how to implement Large Language Model (LLM) features using the Vercel AI SDK. It covers streaming chat, structured object generation, generative UI, and background agents.\n\n**Note**: For Image\u002FVideo generation (Replicate, Fal.ai), continue to use `ai-handler`. Use `ai-sdk-handler` specifically for text, chat, and agentic text\u002FJSON workflows.\n\n## When to Use\n- **Chatbots**: Building interactive chat interfaces (`useChat`, `streamText`).\n- **Structured Data**: Extracting JSON from text (`generateObject`).\n- **Generative UI**: Streaming React components directly from the server (`streamUI`).\n- **Agents**: Complex, multi-step reasoning tasks (often combined with Inngest).\n- **Multimodal**: Handling image inputs with text.\n\n## Capabilities\n\n### 1. Streaming Chat\n- **Tool**: `streamText` (Server), `useChat` (Client).\n- **Pattern**: Create a route handler at `src\u002Fapp\u002Fapi\u002Fchat\u002Froute.ts`.\n- **Auth**: Wrap with `withAuthRequired` to protect the route.\n- **UI**: Use `src\u002Fcomponents\u002Fchat-ui\u002F` for chat components.\n\n### 2. Generative UI (RSC)\n- **Tool**: `streamUI` (Server).\n- **Pattern**: Return React components based on tool calls.\n- **Use Case**: Dashboards that build themselves, dynamic reports.\n\n### 3. Structured Object Generation\n- **Tool**: `generateObject`.\n- **Pattern**: Define a Zod schema and get strictly typed JSON back.\n- **Use Case**: Populating database forms, extracting itinerary details, categorizing content.\n\n### 4. Background Agents (with Inngest)\n- **Tool**: `generateText` \u002F `generateObject` inside Inngest steps.\n- **Why**: Next.js Server Actions\u002FRoutes have timeouts (max 60s usually). Agents taking longer must run in the background.\n- **Pattern**:\n    1. Trigger Inngest event from UI.\n    2. Inngest function runs the LLM logic (loops, multi-step).\n    3. Store result in DB or notify user.\n    4. **Docs**: [AI SDK Agents](https:\u002F\u002Fai-sdk.dev\u002Fdocs\u002Fagents\u002Foverview).\n\n## Best Practices\n\n1.  **Streaming**: Always prefer streaming for text generation > 2 seconds to improve perceived latency.\n2.  **Auth**: Never expose open AI routes. Always verify `session.user.id`.\n3.  **Providers**: Use `@ai-sdk\u002Fopenai` or `@ai-sdk\u002Fanthropic`. Abstract the provider configuration in `src\u002Flib\u002Fai\u002Findex.ts`.\n4.  **Backpressure**: The AI SDK handles this automatically in `streamText`.\n5.  **Caching**: Use `unstable_cache` or KV stores if queries are repetitive.\n6.  **Prompt Engineering**: Keep prompts in a dedicated folder or constant file if they are complex.\n\n## Documentation & Examples\n\n-   **`reference.md`**: Core setup and essential code snippets.\n-   **`examples.md`**: Exhaustive examples covering:\n    1.  Basic Chat\n    2.  Generative UI\n    3.  Structured Object Generation\n    4.  Agents & Workflows (Loop Control)\n    5.  Caching\n    6.  Streaming Data\n    7.  Reading UI Streams\n    8.  Handling Backpressure\n    9.  Multimodal Chat\n",{"deps":38,"name":5,"description":7},[39,40],"auth-handler","inngest-handler","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill ai-sdk-handler",{"tool":56,"command":57},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill ai-sdk-handler",{"tool":59,"command":60},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill ai-sdk-handler","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler\u002FSKILL.md",true,[64,70,76,80,84],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"examples.md","REFERENCE","参考文档",7419,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler\u002Fexamples.md",{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"LICENSE-ADDYOSMANI","LICENSE","许可证",1068,"https:\u002F\u002Fgithub.com\u002Fdmae97\u002Fomk\u002Fblob\u002Fmain\u002F.omk\u002Fskills\u002Fomk-engine\u002FLICENSE-ADDYOSMANI",{"path":77,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":78,"sourceHtmlUrl":79},"reference.md",5542,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler\u002Freference.md",{"path":81,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":82,"sourceHtmlUrl":83},"skill-report.json",20753,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Faayushbaniya2006\u002Fai-sdk-handler\u002Fskill-report.json",{"path":85,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":86,"sourceHtmlUrl":87},"SOURCE.md",2108,"https:\u002F\u002Fgithub.com\u002Fdmae97\u002Fomk\u002Fblob\u002Fmain\u002F.omk\u002Fskills\u002Fomk-engine\u002FSOURCE.md",[89,98,107,115,121,127],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":33},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[95,96,97],"model","model hierarchy","model hierarchy skill",{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":33},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[104,105,106],"MCP","zoom","zoom mcp",{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":33},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[19,113,114,105],"zoom apps sdk","apps",{"skillNo":116,"name":117,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":33},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[117],{"skillNo":122,"name":123,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":33},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[123],{"skillNo":128,"name":129,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":33},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[129]]