/** * Vision shot scoring via OpenAI's chat completions API. * * Self-contained on purpose — gg-ai is for streaming agent loops; this is a * one-shot batch call. Keeps the dependency surface small and lets us tune * the structured-output prompt independently. * * Why OpenAI: gpt-4o-mini is cost-effective (~$0.15/1M tokens) and follows * strict JSON output reliably. Anthropic vision is comparable and could be * added as an alternate backend later. */ export interface FrameToScore { /** Path to a JPEG/PNG file on disk. */ path: string; /** Time in seconds where this frame was sampled. */ atSec: number; } export interface ShotScore { atSec: number; /** 0-10. Higher = better composition / focus / subject clarity. */ score: number; /** One-line reason. ≤ 80 chars. */ why: string; } export interface ScoreOptions { apiKey?: string; model?: string; /** "low" = ~85 tokens/image (cheap), "high" = ~700 tokens/image (more accurate). */ detail?: "low" | "high"; /** Override the system prompt used to instruct the scorer. */ systemPrompt?: string; signal?: AbortSignal; } /** * Score a batch of frames. Splits into requests of ≤20 frames each (OpenAI * vision practical limit). Returns ShotScore[] in the same order as input. */ export declare function scoreFrames(frames: FrameToScore[], opts?: ScoreOptions): Promise; /** * Parse the model's JSON response. Robust to: * - Array-of-objects: `[{score, why}, ...]` * - Object-wrapped: `{"shots": [...]}` or `{"results": [...]}` * - Stray prose around the JSON (extracts first array) */ export declare function parseScoreResponse(content: string, expected: number): Array<{ score?: unknown; why?: unknown; }>; /** Clamp a score value to the 0-10 grading scale. Exposed for testing. */ export declare function clampScore(v: unknown): number; /** Truncate the rationale to 80 chars; non-strings collapse to "". Exposed for testing. */ export declare function clampWhy(v: unknown): string; //# sourceMappingURL=vision.d.ts.map