File size: 1,839 Bytes
253e783 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | /** Public runtime parameter and result types for image generation calls. */
import type { AuthProfileStore } from "../agents/auth-profiles/types.js";
import type { FallbackAttempt } from "../agents/model-fallback.types.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { SsrFPolicy } from "../infra/net/ssrf.js";
import type {
GeneratedImageAsset,
ImageGenerationBackground,
ImageGenerationIgnoredOverride,
ImageGenerationNormalization,
ImageGenerationOutputFormat,
ImageGenerationProviderOptions,
ImageGenerationQuality,
ImageGenerationResolution,
ImageGenerationSourceImage,
} from "./types.js";
export type GenerateImageParams = {
cfg: OpenClawConfig;
prompt: string;
agentDir?: string;
authStore?: AuthProfileStore;
modelOverride?: string;
count?: number;
size?: string;
aspectRatio?: string;
resolution?: ImageGenerationResolution;
/** Resolution inferred from reference images; omitted for incompatible fallback models. */
inferredResolution?: ImageGenerationResolution;
quality?: ImageGenerationQuality;
outputFormat?: ImageGenerationOutputFormat;
background?: ImageGenerationBackground;
inputImages?: ImageGenerationSourceImage[];
autoProviderFallback?: boolean;
/** Optional per-request provider timeout in milliseconds. */
timeoutMs?: number;
providerOptions?: ImageGenerationProviderOptions;
/** SSRF policy to propagate into image-generation provider HTTP calls. */
ssrfPolicy?: SsrFPolicy;
};
export type GenerateImageRuntimeResult = {
images: GeneratedImageAsset[];
provider: string;
model: string;
attempts: FallbackAttempt[];
appliedResolution?: ImageGenerationResolution;
normalization?: ImageGenerationNormalization;
metadata?: Record<string, unknown>;
ignoredOverrides: ImageGenerationIgnoredOverride[];
};
|