AI SDK
The @kirha/ai-sdk package provides a ready-made Vercel AI SDK tool that plugs Kirha search into any LLM with a single function call. No manual tool conversion needed.
kirha-ai/ai-sdk
2
Installation
npm install @kirha/ai-sdkpnpm add @kirha/ai-sdkyarn add @kirha/ai-sdkbun add @kirha/ai-sdkQuick start
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { searchTool } from "@kirha/ai-sdk";
const { text } = await generateText({
model: openai("gpt-5.2"),
tools: { search: searchTool({ vertical: "crypto" }) },
stopWhen: stepCountIs(3),
prompt: "What are the top crypto trends today?",
});
console.log(text);Configuration
Pass options to searchTool() to control the vertical, summarization, and data inclusion:
import { searchTool } from "@kirha/ai-sdk";
const tool = searchTool({
apiKey: process.env.KIRHA_API_KEY,
vertical: "crypto",
summarization: "kirha-flash",
includeData: true,
}); | Option | Description | Default |
|---|---|---|
apiKey | Kirha API key | KIRHA_API_KEY env var |
vertical | Focus searches on a specific vertical | All verticals |
summarization | "kirha", "kirha-flash", or a config object | Disabled |
includeData | Include raw data from providers | true |
includePlanning | Include the execution plan | false |
description | Custom tool description for the model | Default |
Kirha SDK vs AI SDK tool
Use @kirha/ai-sdk when you want a plug-and-play search tool for your AI agent. Use the Kirha TypeScript SDK directly when you need finer control over planning, tool execution, or custom pipelines.