import { APIResource } from "../../../core/resource.js"; import * as JobsAPI from "./jobs.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; /** * Identify key moments in a video. */ export declare class FindKeyMoments extends APIResource { /** * Creates a new job that uses AI to identify key moments in a Mux Video asset. * * @example * ```ts * const findKeyMomentsJob = * await client.robotsPreview.jobs.findKeyMoments.create({ * parameters: { * asset_id: 'mux_asset_123abc', * max_moments: 5, * target_duration_ms: { min: 15000, max: 45000 }, * }, * }); * ``` */ create(body: FindKeyMomentCreateParams, options?: RequestOptions): APIPromise; /** * Retrieves the current status and results of a 'find-key-moments' job. * * @example * ```ts * const findKeyMomentsJob = * await client.robotsPreview.jobs.findKeyMoments.retrieve( * 'rjob_lK9w2kI5J1', * ); * ``` */ retrieve(jobID: string, options?: RequestOptions): APIPromise; } export interface FindKeyMomentsJob { /** * Unique job identifier. */ id: string; /** * Unix timestamp (seconds) when the job was created. */ created_at: number; parameters: FindKeyMomentsJobParameters; /** * Current job status. */ status: JobsAPI.JobStatus; /** * Number of Mux AI units consumed by this job. */ units_consumed: number; /** * Unix timestamp (seconds) when the job was last updated. */ updated_at: number; workflow: 'find-key-moments'; /** * Error details. Present when status is 'errored'. */ errors?: Array; /** * Workflow results. Present when status is 'completed'. */ outputs?: FindKeyMomentsJobOutputs; /** * Arbitrary string supplied at creation, returned as-is. */ passthrough?: string; /** * Related Mux resources linked to this job. */ resources?: FindKeyMomentsJob.Resources; } export declare namespace FindKeyMomentsJob { /** * Related Mux resources linked to this job. */ interface Resources { /** * Mux assets associated with this job. */ assets: Array; } namespace Resources { interface Asset { /** * Mux asset ID. */ id: string; /** * Hypermedia links for the asset. */ _links: Asset._Links; /** * Mux asset metadata, if available. */ meta?: Asset.Meta; /** * Passthrough string from the Mux asset. */ passthrough?: string; } namespace Asset { /** * Hypermedia links for the asset. */ interface _Links { self: _Links.Self; } namespace _Links { interface Self { /** * URL to the Mux asset resource. */ href: string; } } /** * Mux asset metadata, if available. */ interface Meta { /** * Creator identifier from Mux metadata. */ creator_id?: string; /** * External identifier from Mux metadata. */ external_id?: string; /** * Asset title from Mux metadata. */ title?: string; } } } } /** * Workflow results. Present when status is 'completed'. */ export interface FindKeyMomentsJobOutputs { /** * Extracted key moments, ordered by position in the video. */ moments: Array; } export declare namespace FindKeyMomentsJobOutputs { interface Moment { /** * One-sentence summary of what is being said during the moment. */ audible_narrative: string; /** * Contiguous transcript segments that comprise this moment. */ cues: Array; /** * Moment end time in milliseconds. */ end_ms: number; /** * Multi-word descriptive phrases (2-5 words each) capturing key audible concepts. */ notable_audible_concepts: Array; /** * Weighted quality score from 0.0 to 1.0 based on hook strength, clarity, * emotional intensity, novelty, and soundbite quality. */ overall_score: number; /** * Moment start time in milliseconds. */ start_ms: number; /** * Short catchy title for the moment (3-8 words). */ title: string; /** * Scored visual concepts extracted from sampled frames. Present for video assets * only. */ notable_visual_concepts?: Array; /** * One-sentence summary of what is visually happening. Present for video assets * only. */ visual_narrative?: string; } namespace Moment { interface Cue { /** * Cue end time in milliseconds. */ end_ms: number; /** * Cue start time in milliseconds. */ start_ms: number; /** * Transcript text for this cue. */ text: string; } interface NotableVisualConcept { /** * Multi-word visual concept (2-5 words). */ concept: string; /** * Brief explanation of the relevance score. */ rationale: string; /** * Relevance score from 0.0 to 1.0 measuring how closely the visual concept relates * to the audible narrative. */ score: number; } } } export interface FindKeyMomentsJobParameters { /** * The Mux asset ID of the video to analyze. */ asset_id: string; /** * Maximum number of key moments to extract. Defaults to 5. */ max_moments?: number; /** * Preferred highlight duration range in milliseconds. When provided, the model * will aim to select moments within this range. */ target_duration_ms?: FindKeyMomentsJobParameters.TargetDurationMs; } export declare namespace FindKeyMomentsJobParameters { /** * Preferred highlight duration range in milliseconds. When provided, the model * will aim to select moments within this range. */ interface TargetDurationMs { /** * Preferred maximum highlight duration in milliseconds. */ max: number; /** * Preferred minimum highlight duration in milliseconds. */ min: number; } } export interface FindKeyMomentCreateParams { parameters: FindKeyMomentsJobParameters; /** * Arbitrary string stored with the job and returned in responses. Useful for * correlating jobs with your own systems. */ passthrough?: string; } export declare namespace FindKeyMoments { export { type FindKeyMomentsJob as FindKeyMomentsJob, type FindKeyMomentsJobOutputs as FindKeyMomentsJobOutputs, type FindKeyMomentsJobParameters as FindKeyMomentsJobParameters, type FindKeyMomentCreateParams as FindKeyMomentCreateParams, }; } //# sourceMappingURL=find-key-moments.d.ts.map