import { AutoProcessorMediaNode, ProcessorNodeSettings } from "./common"; import { FrameRate } from "../types"; import { Resolution } from "./types"; import { ReasoningSpec, ReasoningProvider } from "./reasoningPlan"; /** * @public * Video configuration for the evaluate node */ export interface ReasoningVideoSettings { resolution: Resolution; frameRate: FrameRate; } /** * @public * LLM response time statistics emitted after each evaluation response. */ export interface EvaluateStatistics { lastResponseTimeMs: number; averageResponseTimeMs: number; sampleCount: number; lastInputTokens: number; lastOutputTokens: number; totalInputTokens: number; totalOutputTokens: number; } /** * @public * Audio energy analysis data from the aggregated local analysis. */ export interface AudioEnergyAnalysis { timestamp: number; rms: number; peak: number; channels: number; } /** * @public * Voice activity detection data from the aggregated local analysis. */ export interface VoiceActivityAnalysis { timestamp: number; active: boolean; confidence: number; } /** * @public * A single detected object from object detection analysis. */ export interface DetectedObjectAnalysis { label: string; confidence: number; bbox: { x1: number; y1: number; x2: number; y2: number; }; } /** * @public * Object detection analysis data from the aggregated local analysis. */ export interface ObjectDetectionAnalysis { timestamp: number; detections: DetectedObjectAnalysis[]; } /** * @public * Scene change detection data from the aggregated local analysis. */ export interface SceneChangeAnalysis { timestamp: number; score: number; detected: boolean; } /** * @public * Aggregated local analysis data emitted at the configured analysis interval. */ export interface SubtitleAnalysis { timestamp: number; text: string; } export interface AggregatedAnalysis { timestamp: number; audioEnergy: AudioEnergyAnalysis[]; vad: VoiceActivityAnalysis[]; objectDetection: ObjectDetectionAnalysis[]; sceneChange: SceneChangeAnalysis[]; subtitles: SubtitleAnalysis[]; } /** * @public * Combined LLM response data emitted after each evaluation cycle. */ export interface LLMResponse { toolCalls: { name: string; arguments: string; }[]; textResponse?: string; statistics: EvaluateStatistics; currentState: string; analysis: AggregatedAnalysis; /** The JPEG image data that was sent to the LLM for this evaluation cycle. */ imageData: Uint8Array; } /** * @public * Status update emitted when the LLM provider returns a retryable error * (e.g. 429 rate limit). Sent before each retry attempt so the user has * real-time visibility into transient failures. */ export interface RetryStatus { attempt: number; maxAttempts: number; delaySeconds: number; errorMessage: string; statusCode: number; } /** * @public * Settings for a ReasoningEvaluateNode. * The spec carries the prompt and state from the plan phase - * evaluate just needs the spec, a provider, and video configuration. */ export interface ReasoningEvaluateSettings extends ProcessorNodeSettings { spec: ReasoningSpec; provider?: ReasoningProvider; videoSettings: ReasoningVideoSettings; analysisIntervalSecs?: number; onLLMResponse?: (response: LLMResponse) => void; onAnalysis?: (analysis: AggregatedAnalysis) => void; onRetry?: (status: RetryStatus) => void; /** Reference documents (markdown) providing domain context for the evaluation LLM. * These are included in the system instruction and cached across frames. */ contextDocuments?: string[]; } /** * @public * A media node that evaluates video frames against a ReasoningSpec. * Subscribes to a video source, sends frames to the evaluation LLM, * and emits tool calls and responses as events. */ export declare class ReasoningEvaluateNode extends AutoProcessorMediaNode<"video" | "audio" | "subtitle"> { /** * Hot-swap the ReasoningSpec while the node is running. */ updateSpec(spec: ReasoningSpec): void; /** * Hot-swap the LLM provider while the node is running. * The current analysis state is carried forward so the session continues seamlessly. */ updateProvider(provider: ReasoningProvider, contextDocuments?: string[]): void; } //# sourceMappingURL=reasoningEvaluate.d.ts.map