ai
Version:
AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript
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>;