{"_id":"@daydreamer-ai/ai","_rev":"2-ea1292b21b4399dcc7e461189bd2c58c","name":"@daydreamer-ai/ai","dist-tags":{"latest":"5.0.10"},"versions":{"5.0.9":{"name":"@daydreamer-ai/ai","version":"5.0.9","keywords":["ai","vercel","sdk","mcp","tool-calling","tools","structured-output","agent","agentic","generative","chatbot","prompt","inference","llm","language-model","streaming"],"license":"Apache-2.0","_id":"@daydreamer-ai/ai@5.0.9","maintainers":[{"name":"floatdreamer","email":"956968770@qq.com"}],"homepage":"https://ai-sdk.dev/docs","bugs":{"url":"https://github.com/vercel/ai/issues"},"dist":{"shasum":"f9c688e00dea9fee25f942448b5142e6b1653908","tarball":"https://registry.npmjs.org/@daydreamer-ai/ai/-/ai-5.0.9.tgz","fileCount":30,"integrity":"sha512-RF0jM4+Ch6IoCekTRH6S2F5JbvPJoMkJ8e+Dc7sWhHBw+Dx+1vgAyKpQJjpJs8nmVHkvBsoIYH2WHdmW01d5Ag==","signatures":[{"sig":"MEUCIGZWZfbfreNRMHsz+ZjgXQQEh/42EyKvcW8TNACdSUa1AiEAhQQ6p3B2PI0KpG9AjoZXXxhPTeMgx/QKDPL8lOKsGdc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2769269},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./test":{"types":"./dist/test/index.d.ts","import":"./dist/test/index.mjs","module":"./dist/test/index.mjs","require":"./dist/test/index.js"},"./internal":{"types":"./dist/internal/index.d.ts","import":"./dist/internal/index.mjs","module":"./dist/internal/index.mjs","require":"./dist/internal/index.js"},"./mcp-stdio":{"types":"./dist/mcp-stdio/index.d.ts","import":"./dist/mcp-stdio/index.mjs","module":"./dist/mcp-stdio/index.mjs","require":"./dist/mcp-stdio/index.js"},"./package.json":"./package.json"},"scripts":{"lint":"eslint \"./**/*.ts*\"","test":"pnpm test:node && pnpm test:edge","build":"tsup --tsconfig tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","test:edge":"vitest --config vitest.edge.config.js --run","test:node":"vitest --config vitest.node.config.js --run","test:watch":"vitest --config vitest.node.config.js","type-check":"tsc --build","build:watch":"tsup --watch --tsconfig tsconfig.build.json","test:update":"pnpm test:node -u","prettier-check":"prettier --check \"./**/*.ts*\""},"_npmUser":{"name":"floatdreamer","email":"956968770@qq.com"},"repository":{"url":"git+https://github.com/vercel/ai.git","type":"git"},"_npmVersion":"10.8.3","description":"AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript","directories":{},"sideEffects":false,"_nodeVersion":"22.9.0","dependencies":{"@ai-sdk/gateway":"workspace:*","@ai-sdk/provider":"workspace:*","@opentelemetry/api":"1.9.0","@ai-sdk/provider-utils":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"3.25.76","tsup":"^7.2.0","eslint":"8.57.1","typescript":"5.8.3","@types/node":"20.17.24","@edge-runtime/vm":"^5.0.0","@types/json-schema":"7.0.15","@vercel/ai-tsconfig":"workspace:*","eslint-config-vercel-ai":"workspace:*"},"peerDependencies":{"zod":"^3.25.76 || ^4"},"_npmOperationalInternal":{"tmp":"tmp/ai_5.0.9_1754914849341_0.5409127046140427","host":"s3://npm-registry-packages-npm-production"}},"5.0.10":{"name":"@daydreamer-ai/ai","version":"5.0.10","description":"AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript","license":"Apache-2.0","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"tsup --tsconfig tsconfig.build.json","build:watch":"tsup --watch --tsconfig tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","lint":"eslint \"./**/*.ts*\"","type-check":"tsc --build","prettier-check":"prettier --check \"./**/*.ts*\"","test":"pnpm test:node && pnpm test:edge","test:update":"pnpm test:node -u","test:watch":"vitest --config vitest.node.config.js","test:edge":"vitest --config vitest.edge.config.js --run","test:node":"vitest --config vitest.node.config.js --run"},"exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./internal":{"types":"./dist/internal/index.d.ts","import":"./dist/internal/index.mjs","module":"./dist/internal/index.mjs","require":"./dist/internal/index.js"},"./test":{"types":"./dist/test/index.d.ts","import":"./dist/test/index.mjs","module":"./dist/test/index.mjs","require":"./dist/test/index.js"},"./mcp-stdio":{"types":"./dist/mcp-stdio/index.d.ts","import":"./dist/mcp-stdio/index.mjs","module":"./dist/mcp-stdio/index.mjs","require":"./dist/mcp-stdio/index.js"}},"dependencies":{"@ai-sdk/gateway":"^1.0.4","@ai-sdk/provider":"^2.0.0","@ai-sdk/provider-utils":"^3.0.1","@opentelemetry/api":"1.9.0"},"devDependencies":{"@edge-runtime/vm":"^5.0.0","@types/json-schema":"7.0.15","@types/node":"20.17.24","eslint":"8.57.1","tsup":"^7.2.0","typescript":"5.8.3","zod":"3.25.76"},"peerDependencies":{"zod":"^3.25.76 || ^4"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"homepage":"https://ai-sdk.dev/docs","repository":{"type":"git","url":"git+https://github.com/vercel/ai.git"},"bugs":{"url":"https://github.com/vercel/ai/issues"},"keywords":["ai","vercel","sdk","mcp","tool-calling","tools","structured-output","agent","agentic","generative","chatbot","prompt","inference","llm","language-model","streaming"],"_id":"@daydreamer-ai/ai@5.0.10","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-8M4Bm9sO4Y3/1TgDbuX73eBqrsz7I0tuE5DDETn5WX8z6cDDXbpneMZ3sPq30k0acBsyGQOulr376kWfvXSgpw==","shasum":"6e8577a05fd5a6e2036b41270adc33118ab7c140","tarball":"https://registry.npmjs.org/@daydreamer-ai/ai/-/ai-5.0.10.tgz","fileCount":30,"unpackedSize":2769167,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIECWg80f4fhsEYnczgebBtyo1kM/YzJWUcmUx+bfgiTRAiB48h68VGYTQ+XmH8vtsY+XKtwWgRc65QmnYTelyBHnTA=="}]},"_npmUser":{"name":"floatdreamer","email":"956968770@qq.com"},"directories":{},"maintainers":[{"name":"floatdreamer","email":"956968770@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai_5.0.10_1754915824325_0.511888963501306"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-11T12:20:49.214Z","modified":"2025-08-11T12:37:04.747Z","5.0.9":"2025-08-11T12:20:49.604Z","5.0.10":"2025-08-11T12:37:04.539Z"},"bugs":{"url":"https://github.com/vercel/ai/issues"},"license":"Apache-2.0","homepage":"https://ai-sdk.dev/docs","keywords":["ai","vercel","sdk","mcp","tool-calling","tools","structured-output","agent","agentic","generative","chatbot","prompt","inference","llm","language-model","streaming"],"repository":{"type":"git","url":"git+https://github.com/vercel/ai.git"},"description":"AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript","maintainers":[{"name":"floatdreamer","email":"956968770@qq.com"}],"readme":"![hero illustration](./assets/hero.gif)\n\n# AI SDK\n\nThe [AI SDK](https://ai-sdk.dev/docs) is a TypeScript toolkit designed to help you build AI-powered applications using popular frameworks like Next.js, React, Svelte, Vue and runtimes like Node.js.\n\nTo learn more about how to use the AI SDK, check out our [API Reference](https://ai-sdk.dev/docs/reference) and [Documentation](https://ai-sdk.dev/docs).\n\n## Installation\n\nYou will need Node.js 18+ and pnpm installed on your local development machine.\n\n```shell\nnpm install ai\n```\n\n## Usage\n\n### AI SDK Core\n\nThe [AI SDK Core](https://ai-sdk.dev/docs/ai-sdk-core/overview) module provides a unified API to interact with model providers like [OpenAI](https://ai-sdk.dev/providers/ai-sdk-providers/openai), [Anthropic](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic), [Google](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai), and more.\n\nYou will then install the model provider of your choice.\n\n```shell\nnpm install @ai-sdk/openai\n```\n\n###### @/index.ts (Node.js Runtime)\n\n```ts\nimport { generateText } from 'ai';\nimport { openai } from '@ai-sdk/openai'; // Ensure OPENAI_API_KEY environment variable is set\n\nconst { text } = await generateText({\n  model: openai('gpt-4o'),\n  system: 'You are a friendly assistant!',\n  prompt: 'Why is the sky blue?',\n});\n\nconsole.log(text);\n```\n\n### AI SDK UI\n\nThe [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) 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.\n\nYou need to install the package for your framework:\n\n```shell\nnpm install @ai-sdk/react\n```\n\n###### @/app/page.tsx (Next.js App Router)\n\n```tsx\n'use client';\n\nimport { useChat } from '@ai-sdk/react';\n\nexport default function Page() {\n  const { messages, input, handleSubmit, handleInputChange, status } =\n    useChat();\n\n  return (\n    <div>\n      {messages.map(message => (\n        <div key={message.id}>\n          <strong>{`${message.role}: `}</strong>\n          {message.parts.map((part, index) => {\n            switch (part.type) {\n              case 'text':\n                return <span key={index}>{part.text}</span>;\n\n              // other cases can handle images, tool calls, etc\n            }\n          })}\n        </div>\n      ))}\n\n      <form onSubmit={handleSubmit}>\n        <input\n          value={input}\n          placeholder=\"Send a message...\"\n          onChange={handleInputChange}\n          disabled={status !== 'ready'}\n        />\n      </form>\n    </div>\n  );\n}\n```\n\n###### @/app/api/chat/route.ts (Next.js App Router)\n\n```ts\nimport { streamText } from 'ai';\nimport { openai } from '@ai-sdk/openai';\n\nexport async function POST(req: Request) {\n  const { messages } = await req.json();\n\n  const result = streamText({\n    model: openai('gpt-4o'),\n    system: 'You are a helpful assistant.',\n    messages,\n  });\n\n  return result.toUIMessageStreamResponse();\n}\n```\n\n## Templates\n\nWe've built [templates](https://vercel.com/templates?type=ai) 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.\n\n## Community\n\nThe AI SDK community can be found on [GitHub Discussions](https://github.com/vercel/ai/discussions) where you can ask questions, voice ideas, and share your projects with other people.\n\n## Contributing\n\nContributions to the AI SDK are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](https://github.com/vercel/ai/blob/main/CONTRIBUTING.md) to make sure you have smooth experience contributing to AI SDK.\n\n## Authors\n\nThis library is created by [Vercel](https://vercel.com) and [Next.js](https://nextjs.org) team members, with contributions from the [Open Source Community](https://github.com/vercel/ai/graphs/contributors).\n","readmeFilename":"README.md"}