ractogateway.pipelines.video_processor._analyzer
Vision LLM frame analysis for VideoProcessorPipeline.
- Supports two modes:
INDIVIDUAL – one LLM call per frame (highest accuracy) GRID – stitch N frames into a collage grid -> one LLM call per batch
(fewer API calls, lower cost)
Uses RactoGateway’s existing RactoFile + ChatConfig.attachments interface so any vision-capable kit (OpenAI gpt-4o, Anthropic claude-3, Gemini 1.5, …) works transparently.
- ractogateway.pipelines.video_processor._analyzer.analyze_frames_sync(frames, kit, *, mode, batch_size, max_workers, grid_size, usage)[source]
Analyse all kept frames synchronously via a ThreadPoolExecutor.
Updates usage in place with token counts. Returns a new list of
FrameEntrywithanalysispopulated.- Return type:
list[FrameEntry]
- async ractogateway.pipelines.video_processor._analyzer.analyze_frames_async(frames, kit, *, mode, batch_size, max_workers, grid_size, usage)[source]
Async variant — Semaphore-based concurrency: all tasks submitted at once, capped to max_workers in-flight. Eliminates the head-of-line blocking of the old batch-by-batch approach so a slow frame never delays fast ones.
- Return type:
list[FrameEntry]