WIP typescript conversion
This commit is contained in:
111
src/interfaces/index.ts
Normal file
111
src/interfaces/index.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
// Common interfaces for the application
|
||||
|
||||
// Vision provider interfaces
|
||||
export interface VisionUsage {
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
totalTokens: number;
|
||||
}
|
||||
|
||||
export interface VisionResult {
|
||||
description: string;
|
||||
usage: VisionUsage;
|
||||
}
|
||||
|
||||
export interface VisionProviderConfig {
|
||||
apiKey?: string;
|
||||
model: string;
|
||||
maxTokens?: number;
|
||||
baseUrl?: string;
|
||||
}
|
||||
|
||||
export interface VisionProvider {
|
||||
describeImage(imagePath: string, prompt: string): Promise<VisionResult>;
|
||||
compareImages(image1Path: string, image2Path: string, prompt: string): Promise<VisionResult>;
|
||||
describeBatch(
|
||||
imagePaths: string[],
|
||||
lastBatchContext: any,
|
||||
prompt: string
|
||||
): Promise<VisionResult>;
|
||||
}
|
||||
|
||||
// TTS provider interfaces
|
||||
export interface TTSResult {
|
||||
duration: number;
|
||||
cost: number;
|
||||
}
|
||||
|
||||
export interface TTSOptions {
|
||||
voice?: string;
|
||||
model?: string;
|
||||
speedFactor?: number;
|
||||
}
|
||||
|
||||
export interface TTSProviderConfig {
|
||||
apiKey?: string;
|
||||
model: string;
|
||||
voice?: string;
|
||||
}
|
||||
|
||||
export interface TTSProvider {
|
||||
textToSpeech(
|
||||
text: string,
|
||||
outputPath: string,
|
||||
options?: TTSOptions
|
||||
): Promise<TTSResult>;
|
||||
}
|
||||
|
||||
// Audio segment interface
|
||||
export interface AudioSegment {
|
||||
audioFile: string;
|
||||
startTime: number;
|
||||
duration: number;
|
||||
description: string;
|
||||
}
|
||||
|
||||
// Stats interface
|
||||
export interface Stats {
|
||||
totalFrames: number;
|
||||
totalBatches: number;
|
||||
totalVisionInputCost: number;
|
||||
totalVisionOutputCost: number;
|
||||
totalTTSCost: number;
|
||||
totalCost: number;
|
||||
}
|
||||
|
||||
// Batch context interface
|
||||
export interface BatchContext {
|
||||
lastDescription?: string;
|
||||
lastFramePaths?: string[];
|
||||
}
|
||||
|
||||
// Result interfaces
|
||||
export interface ProcessingResult {
|
||||
videoFile: string;
|
||||
audioDescriptionFile: string;
|
||||
}
|
||||
|
||||
export interface CostBreakdown {
|
||||
videoInfo: {
|
||||
duration: number;
|
||||
totalUnits: number;
|
||||
unitType: string;
|
||||
processingInterval: number;
|
||||
};
|
||||
providerInfo: {
|
||||
visionProvider: string;
|
||||
visionModel: string;
|
||||
ttsProvider: string;
|
||||
ttsModel: string;
|
||||
};
|
||||
apiCosts: {
|
||||
visionInput: string;
|
||||
visionOutput: string;
|
||||
tts: string;
|
||||
total: string;
|
||||
};
|
||||
estimates: {
|
||||
totalAPICallsToProviders: number;
|
||||
estimatedProcessingTimeMinutes: number;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user