UNPKG

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.

27 lines (22 loc) 652 B
import { AISDKError } from '@ai-sdk/provider'; const name = 'AI_NoOutputGeneratedError'; const marker = `vercel.ai.error.${name}`; const symbol = Symbol.for(marker); /** * Thrown when no LLM output was generated, e.g. because of errors. */ export class NoOutputGeneratedError extends AISDKError { private readonly [symbol] = true; // used in isInstance constructor({ message = 'No output generated.', cause, }: { message?: string; cause?: Error; } = {}) { super({ name, message, cause }); } static isInstance(error: unknown): error is NoOutputGeneratedError { return AISDKError.hasMarker(error, marker); } }