SuperAPI AI 工具集

ai-core

智能体与模型

查看项目

更新于 10-16 05:46

技能介绍

用途:ai-core 是 TanStack AI 技能的入口点,本身不实现功能,而是按需求把开发者路由到对应子技能文档(SKILL.md),覆盖聊天、工具调用、媒体生成、结构化输出、适配器配置、AG-UI 协议、中间件、锁、自定义后端集成、调试日志等主题。

主要能力:提供快速决策树,例如搭建聊天机器人读 ai-core/chat-experience,添加函数调用读 ai-core/tool-calling,生成图像/音频/视频读 ai-core/media-generation,需要结构化 JSON 读 ai-core/structured-outputs,选择或配置提供商读 ai-core/adapter-configuration,构建服务端 AG-UI 后端读 ai-core/ag-ui-protocol,添加分析或流后事件读 ai-core/middleware,连接自定义后端读 ai-core/custom-backend-integration,开启调试日志读 ai-core/debug-logging。

配套包:@tanstack/ai-persistence 提供持久化聊天状态(MessageStore、RunStore、InterruptStore、MetadataStore、withPersistence、reconstructChat 等),安装命令为 pnpm add @tanstack/ai-persistence 与 npx @tanstack/intent@latest install;@tanstack/ai-code-mode 提供 LLM 代码执行;@tanstack/ai-skills 通过 withSkills 中间件和 load_skill 工具让模型按需加载 SKILL.md。

关键规则:这不是 Vercel AI SDK,使用 chat() 而非 streamText(),使用 openaiText() 而非 createOpenAI(),从 @tanstack/ai 导入而非 ai;客户端从框架包(如 @tanstack/ai-react)导入,不要直接用 @tanstack/ai-client;用 toServerSentEventsResponse() 转换流,不要手写 SSE;生命周期事件用 middleware,chat() 没有 onEnd/onFinish 回调;工具需同时传给服务端和客户端,客户端通过 clientTools() 传入 tools 选项。目标版本为 TanStack AI v0.42.0。

限制:资料未提供具体收费、价格、平台支持范围或效果数据;持久化包不提供数据库后端,需自行实现存储接口。