import { FinishReason } from "@google/generative-ai";
import { LangChainError } from "@langchain/core/errors";
//#region src/utils/errors.d.ts
interface EmptyContentErrorParams {
  /**
   * The candidate's `finishReason`, when available (e.g. `"SAFETY"`,
   * `"RECITATION"`, `"MALFORMED_FUNCTION_CALL"`, `"MAX_TOKENS"`, `"OTHER"`).
   */
  finishReason?: FinishReason | string;
  /**
   * The prompt-level `blockReason`, when the request was rejected before
   * any candidate was generated at all.
   */
  blockReason?: string;
  /**
   * Optional custom error message. If not provided, a default message is
   * generated from `finishReason`/`blockReason`.
   */
  message?: string;
}
declare const EmptyContentError_base: typeof LangChainError & {
  isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
};
/**
 * Error thrown by non-streaming calls (`.invoke()`, `.generate()`,
 * `.batch()`) when a Gemini candidate is returned with no usable content.
 *
 * This covers two distinct situations that both surface the same way —
 * a candidate with no `content` at all:
 * - An explicit block from Google (a safety/recitation/prohibited-content
 *   filter, or a rejected prompt via `blockReason`).
 * - The model just not producing usable output for other reasons, e.g. a
 *   thinking model exhausting its token budget on reasoning (`MAX_TOKENS`)
 *   or an invalid tool call (`MALFORMED_FUNCTION_CALL`) — nothing was
 *   "blocked" in either case, the model simply returned nothing.
 *
 * Previously this was silently converted into an empty message; it's now
 * surfaced as a typed, catchable error. Check `finishReason`/`blockReason`
 * to distinguish an explicit block from the model just being odd.
 *
 * Note: `.stream()` does not throw this error. A contentless candidate
 * mid-stream is silently skipped there instead, since a single missing
 * chunk isn't necessarily fatal to an otherwise-successful stream.
 *
 * @example
 * ```typescript
 * try {
 *   await model.invoke("...");
 * } catch (error) {
 *   if (EmptyContentError.isInstance(error)) {
 *     console.log(`No content: ${error.finishReason ?? error.blockReason}`);
 *   }
 * }
 * ```
 */
declare class EmptyContentError extends EmptyContentError_base {
  readonly name = "EmptyContentError";
  readonly finishReason?: FinishReason | string;
  readonly blockReason?: string;
  constructor(params?: EmptyContentErrorParams);
}
//#endregion
export { EmptyContentError, EmptyContentErrorParams };
//# sourceMappingURL=errors.d.ts.map