@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
41 lines (40 loc) • 1.17 kB
JavaScript
import { snapToDurationOption } from "./snap.js";
//#region src/activities/generateVideo/adapter.ts
/**
* Abstract base class for video generation adapters.
* Extend this class to implement a video adapter for a specific provider.
*
* @experimental Video generation is an experimental feature and may change.
*
* Generic parameters match VideoAdapter - all pre-resolved by the provider function.
*/
var BaseVideoAdapter = class {
kind = "video";
supportsFileSources = false;
model;
config;
constructor(config = {}, model) {
this.config = config;
this.model = model;
}
/**
* Default implementation returns `{ kind: 'none' }`. Adapters that have
* declared their per-model duration map should override this.
*/
availableDurations() {
return { kind: "none" };
}
/**
* Uses `availableDurations()`. Adapters that declare a duration map only
* need to override that method.
*/
snapDuration(input) {
return snapToDurationOption(input, this.availableDurations());
}
generateId() {
return `${this.name}-${Date.now()}-${Math.random().toString(36).substring(7)}`;
}
};
//#endregion
export { BaseVideoAdapter };
//# sourceMappingURL=adapter.js.map