export type PromptLimitTokenizer = 'umt5' | 't5xxl' | 'clip' | 'minimax-music3'; export interface CharacterPromptLimit { unit: 'characters'; max: number; cjkWeight?: number; } export interface TokenPromptLimit { unit: 'tokens'; max: number; tokenizer: PromptLimitTokenizer; addedTokens: number; } export type PromptFieldLimit = CharacterPromptLimit | TokenPromptLimit; export type PromptLimitFamily = 'wan2.2' | 'flux1' | 'chroma' | 'minimax-h3' | 'wan3' | 'gpt-image' | 'happyhorse' | 'seedance' | 'ace-step' | 'minimax-music3' | 'sam3'; export interface PromptLengthAdvisory { englishWords: number; chineseCharacters: number; } export interface GenerationPromptLimits { family: PromptLimitFamily; modelName: string; prompt?: PromptFieldLimit; negativePrompt?: PromptFieldLimit; lyrics?: PromptFieldLimit; promptWithLyrics?: PromptFieldLimit; advisory?: PromptLengthAdvisory; instruction: string; } export type PromptLimitField = 'prompt' | 'negativePrompt' | 'lyrics' | 'promptWithLyrics'; export interface GenerationPromptText { prompt?: string | null; stylePrompt?: string | null; negativePrompt?: string | null; lyrics?: string | null; } export interface PromptLimitViolation { field: PromptLimitField; unit: 'characters' | 'tokens'; max: number; measured: number; exact: boolean; characters: number; message: string; } export declare const PROMPT_TOO_LONG_ERROR_CODE = 4102; export declare class PromptTooLongError extends Error { readonly modelId: string; readonly violations: readonly PromptLimitViolation[]; readonly code = 4102; constructor(modelId: string, violations: readonly PromptLimitViolation[]); } export declare function resolvePromptLimitFamily(modelId: string | null | undefined): PromptLimitFamily | null; export declare function resolveGenerationPromptLimits(modelId: string | null | undefined): GenerationPromptLimits | null; export declare function promptLimitInstruction(modelId: string | null | undefined): string | null; export declare function promptTokenLowerBound(limit: TokenPromptLimit, text: string): number; export interface PromptFieldMeasurement { measured: number; exact: boolean; characters: number; } export declare function measurePromptField(limit: PromptFieldLimit, text: string): PromptFieldMeasurement; export declare function checkGenerationPromptLimits(modelId: string | null | undefined, text: GenerationPromptText): PromptLimitViolation[]; export declare function assertGenerationPromptWithinLimits(modelId: string | null | undefined, text: GenerationPromptText): void; export declare function promptLimitRepairInstruction(modelId: string | null | undefined, violations: readonly PromptLimitViolation[]): string; export declare function promptLengthAdvisory(modelId: string | null | undefined, prompt: string | null | undefined): string | null; export declare const VIDEO_PROMPT_LENGTH_LIMITS_GUIDANCE = "PROMPT LENGTH LIMITS (an over-limit request is refused, never cut): MiniMax H3 at most 7,000 characters; HappyHorse at most 5,000 (each Chinese character counts as 2); Wan 3 at most 20,000; Wan 2.2 at most 4,096 tokens (about 3,000 English words) for the prompt and for negativePrompt. Seedance keeps the most detail under 1,000 English words or 500 Chinese characters. Stay well under these; condense wording instead of dropping required content."; export declare const MUSIC_TEXT_LENGTH_LIMITS_GUIDANCE = "LENGTH LIMITS (an over-limit request is refused, never cut): ACE-Step accepts at most 4,096 characters of prompt and at most 4,096 characters of lyrics, tags and line breaks included; MiniMax Music 3 (music3) reads at most 5,000 tokens of prompt and lyrics together (about 3,500 English words). Keep ACE-Step lyrics under 3,500 characters."; export declare const SAM3_TEXT_LENGTH_GUIDANCE = "SAM 3 reads at most 32 tokens, its start and end tokens included: use a short noun phrase of at most 20 words."; export interface ToolArgumentPromptLimitViolation extends PromptLimitViolation { argument: string; modelId: string; } export declare function checkToolArgumentPromptLimits(toolName: string, args: Record): ToolArgumentPromptLimitViolation[]; //# sourceMappingURL=promptLimits.d.ts.map