import { type ZodType, z } from "zod"; import type { PromiseOrValue } from "../utils/type-utils.js"; import type { AgentInvokeOptions, AgentOptions, AgentProcessResult, AgentResponse, AgentResponseStream, GetterSchema, Message } from "./agent.js"; import { type ChatModelOutputUsage } from "./chat-model.js"; import { type FileType, type FileUnionContent, Model } from "./model.js"; export interface ImageModelOptions extends Omit, "model"> { model?: string; modelOptions?: ImageModelInputOptionsWithGetter; } export declare abstract class ImageModel extends Model { options?: ImageModelOptions | undefined; tag: string; constructor(options?: ImageModelOptions | undefined); get credential(): PromiseOrValue<{ url?: string; apiKey?: string; model?: string; }>; protected preprocess(input: I, options: AgentInvokeOptions): Promise; protected postprocess(input: I, output: O, options: AgentInvokeOptions): Promise; abstract process(input: I, options: AgentInvokeOptions): PromiseOrValue>; protected processAgentOutput(input: I, output: Exclude, AgentResponseStream>, options: AgentInvokeOptions): Promise; } export type ImageModelInputImage = FileUnionContent[]; export interface ImageModelInput extends Message { prompt: string; image?: ImageModelInputImage; n?: number; outputFileType?: FileType; modelOptions?: ImageModelInputOptions; } export interface ImageModelInputOptions extends Record { model?: string; preferInputFileType?: "file" | "url"; } export type ImageModelInputOptionsWithGetter = GetterSchema; export declare const imageModelInputSchema: z.ZodObject<{ prompt: z.ZodString; image: z.ZodOptional; mimeType: ZodType; } & { type: z.ZodLiteral<"local">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; }, { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; }>, z.ZodObject<{ filename: ZodType; mimeType: ZodType; } & { type: z.ZodLiteral<"url">; url: z.ZodString; }, "strip", z.ZodTypeAny, { type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; }, { type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; }>, z.ZodObject<{ filename: ZodType; mimeType: ZodType; } & { type: z.ZodLiteral<"file">; data: z.ZodString; }, "strip", z.ZodTypeAny, { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; }, { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; }>]>, "many">>; n: z.ZodOptional; outputFileType: z.ZodOptional>; modelOptions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { prompt: string; modelOptions?: Record | undefined; image?: ({ type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; } | { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; } | { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; })[] | undefined; n?: number | undefined; outputFileType?: "local" | "file" | "url" | undefined; }, { prompt: string; modelOptions?: Record | undefined; image?: ({ type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; } | { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; } | { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; })[] | undefined; n?: number | undefined; outputFileType?: "local" | "file" | "url" | undefined; }>; export interface ImageModelOutput extends Message { images: FileUnionContent[]; /** * Token usage statistics */ usage?: ChatModelOutputUsage; /** * Model name or version used */ model?: string; } export declare const imageModelOutputSchema: z.ZodObject<{ images: z.ZodArray; mimeType: ZodType; } & { type: z.ZodLiteral<"local">; path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; }, { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; }>, z.ZodObject<{ filename: ZodType; mimeType: ZodType; } & { type: z.ZodLiteral<"url">; url: z.ZodString; }, "strip", z.ZodTypeAny, { type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; }, { type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; }>, z.ZodObject<{ filename: ZodType; mimeType: ZodType; } & { type: z.ZodLiteral<"file">; data: z.ZodString; }, "strip", z.ZodTypeAny, { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; }, { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; }>]>, "many">; usage: z.ZodOptional; cacheCreationInputTokens: ZodType; cacheReadInputTokens: ZodType; creditPrefix: ZodType<"$" | "€" | "¥" | undefined, z.ZodTypeDef, "$" | "€" | "¥" | undefined>; }, "strip", z.ZodTypeAny, { inputTokens: number; outputTokens: number; aigneHubCredits?: number | undefined; cacheCreationInputTokens?: number | undefined; cacheReadInputTokens?: number | undefined; creditPrefix?: "$" | "€" | "¥" | undefined; }, { inputTokens: number; outputTokens: number; aigneHubCredits?: number | undefined; cacheCreationInputTokens?: number | undefined; cacheReadInputTokens?: number | undefined; creditPrefix?: "$" | "€" | "¥" | undefined; }>>; model: z.ZodOptional; }, "strip", z.ZodTypeAny, { images: ({ type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; } | { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; } | { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; })[]; model?: string | undefined; usage?: { inputTokens: number; outputTokens: number; aigneHubCredits?: number | undefined; cacheCreationInputTokens?: number | undefined; cacheReadInputTokens?: number | undefined; creditPrefix?: "$" | "€" | "¥" | undefined; } | undefined; }, { images: ({ type: "url"; url: string; filename?: string | undefined; mimeType?: string | undefined; } | { type: "file"; data: string; filename?: string | undefined; mimeType?: string | undefined; } | { path: string; type: "local"; filename?: string | undefined; mimeType?: string | undefined; })[]; model?: string | undefined; usage?: { inputTokens: number; outputTokens: number; aigneHubCredits?: number | undefined; cacheCreationInputTokens?: number | undefined; cacheReadInputTokens?: number | undefined; creditPrefix?: "$" | "€" | "¥" | undefined; } | undefined; }>;