ai
Version:
AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.
13 lines (11 loc) • 390 B
text/typescript
import { JSONParseError, TypeValidationError } from '@ai-sdk/provider';
/**
* A function that attempts to repair the raw output of the model
* to enable JSON parsing.
*
* Should return the repaired text or null if the text cannot be repaired.
*/
export type RepairTextFunction = (options: {
text: string;
error: JSONParseError | TypeValidationError;
}) => Promise<string | null>;