mirror of https://github.com/openclaw/openclaw.git
75 lines
1.8 KiB
TypeScript
75 lines
1.8 KiB
TypeScript
import type { AuthProfileStore } from "../agents/auth-profiles.js";
|
|
import type { OpenClawConfig } from "../config/config.js";
|
|
|
|
export type GeneratedImageAsset = {
|
|
buffer: Buffer;
|
|
mimeType: string;
|
|
fileName?: string;
|
|
revisedPrompt?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationResolution = "1K" | "2K" | "4K";
|
|
|
|
export type ImageGenerationSourceImage = {
|
|
buffer: Buffer;
|
|
mimeType: string;
|
|
fileName?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationRequest = {
|
|
provider: string;
|
|
model: string;
|
|
prompt: string;
|
|
cfg: OpenClawConfig;
|
|
agentDir?: string;
|
|
authStore?: AuthProfileStore;
|
|
timeoutMs?: number;
|
|
count?: number;
|
|
size?: string;
|
|
aspectRatio?: string;
|
|
resolution?: ImageGenerationResolution;
|
|
inputImages?: ImageGenerationSourceImage[];
|
|
};
|
|
|
|
export type ImageGenerationResult = {
|
|
images: GeneratedImageAsset[];
|
|
model?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationModeCapabilities = {
|
|
maxCount?: number;
|
|
supportsSize?: boolean;
|
|
supportsAspectRatio?: boolean;
|
|
supportsResolution?: boolean;
|
|
};
|
|
|
|
export type ImageGenerationEditCapabilities = ImageGenerationModeCapabilities & {
|
|
enabled: boolean;
|
|
maxInputImages?: number;
|
|
};
|
|
|
|
export type ImageGenerationGeometryCapabilities = {
|
|
sizes?: string[];
|
|
aspectRatios?: string[];
|
|
resolutions?: ImageGenerationResolution[];
|
|
};
|
|
|
|
export type ImageGenerationProviderCapabilities = {
|
|
generate: ImageGenerationModeCapabilities;
|
|
edit: ImageGenerationEditCapabilities;
|
|
geometry?: ImageGenerationGeometryCapabilities;
|
|
};
|
|
|
|
export type ImageGenerationProvider = {
|
|
id: string;
|
|
aliases?: string[];
|
|
label?: string;
|
|
defaultModel?: string;
|
|
models?: string[];
|
|
capabilities: ImageGenerationProviderCapabilities;
|
|
generateImage: (req: ImageGenerationRequest) => Promise<ImageGenerationResult>;
|
|
};
|