Tooling for Vercel AI SDK: enable tool calling with models lacking native tools, plus evaluation utilities.
- @ai-sdk-tool/parser: add tool-calling via middleware; works with any provider supported by AI SDK
wrapLanguageModel. - @ai-sdk-tool/eval: benchmarks and evaluation helpers (BFCL, JSON generation).
import { wrapLanguageModel, streamText } from "ai";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { xmlToolMiddleware } from "@ai-sdk-tool/parser";
const client = createOpenAICompatible({
/* baseURL, apiKey */
});
const result = streamText({
model: wrapLanguageModel({
model: client("your-model-name"),
middleware: xmlToolMiddleware,
}),
tools: {
/* your tools */
},
prompt: "Find weather for Seoul today",
});
for await (const part of result.fullStream) {
// handle text and tool events
}