{"_id":"@keenable/ai-sdk","_rev":"3-619358c9c169fb37f36d75de4009c7b6","name":"@keenable/ai-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@keenable/ai-sdk","version":"0.1.0","keywords":["ai","ai-sdk","vercel","keenable","web-search","search","fetch","tools","agents"],"author":{"name":"Keenable"},"license":"MIT","_id":"@keenable/ai-sdk@0.1.0","maintainers":[{"name":"ilya.bogin","email":"ilya.bogin@keenable.ai"},{"name":"ilyagusev","email":"ilya.gusev@keenable.ai"},{"name":"grigorevp","email":"p@grigorev.me"}],"homepage":"https://keenable.ai","bugs":{"url":"https://github.com/keenableai/keenable-integrations/issues"},"dist":{"shasum":"c80e030d47a711e1ea1784dfb8cc215610d21d6c","tarball":"https://registry.npmjs.org/@keenable/ai-sdk/-/ai-sdk-0.1.0.tgz","fileCount":9,"integrity":"sha512-ihQptABoJASRdx5k7DW9n5s98D2i9aHARePFAWEkLQyB9wPWGDTAax/Y1nDD/iBIWl8+rDy3fVCeP+7S8lKdpA==","signatures":[{"sig":"MEUCIAFtPHVmDkjiy5A7Zg7TUN9ZXaDF99GvKdDY/ngcSF3fAiEA2L3aKMtPoOL00hPkRf5t8Y4ia9/fWKz6QMOHKsxhtsA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147749},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"e2e":"node e2e/live.mjs","test":"vitest run","build":"tsup","check":"tsc --noEmit"},"_npmUser":{"name":"ilya.bogin","email":"ilya.bogin@keenable.ai"},"repository":{"url":"git+https://github.com/keenableai/keenable-integrations.git","type":"git","directory":"vercel-ai-sdk/plugin"},"_npmVersion":"10.9.2","description":"Keenable web search and page-fetch tools for the Vercel AI SDK. Keyless by default.","directories":{},"_nodeVersion":"23.11.0","dependencies":{"keenable":"^0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^7.0.66","zod":"^4.4.3","tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.9.3","@types/node":"^24.10.1"},"peerDependencies":{"ai":"^5.0.0 || ^6.0.0 || ^7.0.0","zod":"^3.25.0 || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-sdk_0.1.0_1787048967041_0.06521809260685929","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-08-18T10:29:26.818Z","modified":"2026-11-20T15:17:50.895Z","0.1.0":"2026-08-18T10:29:27.179Z"},"bugs":{"url":"https://github.com/keenableai/keenable-integrations/issues"},"author":{"name":"Keenable"},"license":"MIT","homepage":"https://keenable.ai","keywords":["ai","ai-sdk","vercel","keenable","web-search","search","fetch","tools","agents"],"repository":{"url":"git+https://github.com/keenableai/keenable-integrations.git","type":"git","directory":"vercel-ai-sdk/plugin"},"description":"Keenable web search and page-fetch tools for the Vercel AI SDK. Keyless by default.","maintainers":[{"email":"ilya.bogin@keenable.ai","name":"ilya.bogin"},{"email":"ilya.gusev@keenable.ai","name":"ilyagusev"},{"email":"karl.gustav1789@gmail.com","name":"gggustav"}],"readme":"# @keenable/ai-sdk\n\n[Keenable](https://keenable.ai) web search and page-fetch tools for the\n[Vercel AI SDK](https://ai-sdk.dev).\n\n**Keyless by default.** The tools work with no account and no API key against\nKeenable's public endpoints. An optional `KEENABLE_API_KEY` lifts the hourly\nrate limit; it is never a prerequisite, so an example using these tools runs\nfor whoever copies it.\n\n## Installation\n\n```bash\nnpm install @keenable/ai-sdk\n```\n\n`ai` and `zod` are peer dependencies, and you already have both in an AI SDK\nproject. There is no provider SDK to install: the package talks to the Keenable\nHTTP API through the official [`keenable`](https://www.npmjs.com/package/keenable)\nclient. Node 18 or newer.\n\n## Quick start\n\n```ts\nimport { openai } from \"@ai-sdk/openai\";\nimport { generateText, stepCountIs } from \"ai\";\nimport { keenableTools } from \"@keenable/ai-sdk\";\n\nconst { text } = await generateText({\n  model: openai(\"gpt-5.6-sol\"),\n  tools: keenableTools(),\n  stopWhen: stepCountIs(6),\n  prompt: \"What changed in the latest Bun release? Cite the pages you used.\",\n});\n```\n\n`keenableTools()` returns both tools keyed by the names the model sees,\n`keenable_search` and `keenable_fetch`, sharing one client. Pass a key to lift\nthe rate limit, or leave it out entirely:\n\n```ts\nconst tools = keenableTools({ apiKey: process.env.KEENABLE_API_KEY });\n```\n\n## The tools\n\n### `keenable_search`\n\nSearches the web and returns ranked pages, each with the page text already\nextracted, so a typical question is answered without a second round trip.\n\n```ts\nimport { keenableSearch } from \"@keenable/ai-sdk\";\n\nconst tools = {\n  keenable_search: keenableSearch({\n    site: \"arxiv.org\", // pin every search to one domain\n    maxResults: 5,\n    snippetMaxLength: 2000,\n  }),\n};\n```\n\nReturns `{ query, results: [{ title, url, snippet, publishedAt }] }`. The page\ntext is in `snippet`; `description` is the page's meta description and is\nabsent for most pages, so it is not returned at all.\n\nThe model can also set `site`, `publishedAfter` and `publishedBefore` per call.\nAnything you configure on the tool is the default when the model leaves it out.\n\n| Option | Default | What it does |\n|---|---|---|\n| `site` | unset | Restrict every search to one domain |\n| `publishedAfter` / `publishedBefore` | unset | Publication-date window (`YYYY-MM-DD`) |\n| `maxResults` | all | Keep at most this many results |\n| `snippetMaxLength` | `1000` | Characters of page text kept per result |\n\n`snippetMaxLength` matters more here than with other search APIs: Keenable\nreturns whole-page text on every result, an order of magnitude more than a\ntypical snippet, so an uncapped result set would spend the context window on\npages the model never chose to read. `keenable_fetch` is how it opts into one.\n\n### `keenable_fetch`\n\nReads one URL and returns its main content as markdown, boilerplate stripped.\n\n```ts\nimport { keenableFetch } from \"@keenable/ai-sdk\";\n\nconst tools = { keenable_fetch: keenableFetch({ contentMaxLength: 20_000 }) };\n```\n\nReturns `{ url, title, content, publishedAt }`. Longer pages are truncated and\nmarked with `[truncated]`, and the marker counts against `contentMaxLength`, so\nthe tool never returns more than the budget it was given.\n\n## Configuration\n\nEvery client option of the [`keenable`](https://www.npmjs.com/package/keenable)\nSDK is accepted by all three factories:\n\n| Option | Environment | Purpose |\n|---|---|---|\n| `apiKey` | `KEENABLE_API_KEY` | Lifts the hourly rate limit. Optional |\n| `baseUrl` | `KEENABLE_API_URL` | Point at a different Keenable deployment |\n| `timeoutMs` | | Request timeout, default 30000 |\n| `fetch` | | Custom fetch, for a proxy or a test |\n| `client` | | A `Keenable` instance to use as-is |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}