@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
22 lines (21 loc) • 892 B
TypeScript
/**
* Schema-Driven Tool Call Repair (BZ-665)
*
* Implements `experimental_repairToolCall` for the Vercel AI SDK.
* When an LLM sends a wrong tool name or wrong parameter names,
* this module attempts deterministic, schema-driven repair:
*
* 1. Tool name: case-insensitive → substring → Levenshtein
* 2. Param names: compare against JSON schema properties dynamically
* 3. Type coercion: string→number, JSON string→object/array per schema
*
* Zero static alias maps. The tool's JSON schema is the only source of truth.
*
* @module utils/toolCallRepair
*/
import type { ToolCallRepairFunction, ToolSet } from "ai";
/**
* Create an `experimental_repairToolCall` handler for streamText/generateText.
* Fully dynamic — reads the tool schema at repair time, no configuration needed.
*/
export declare function createToolCallRepair(): ToolCallRepairFunction<ToolSet>;