Modernize codebase

This commit is contained in:
2026-05-13 02:17:07 +02:00
parent 507d4f6474
commit fc02d2001c
13 changed files with 6190 additions and 954 deletions

View File

@@ -37,31 +37,29 @@ export async function estimateCost(
console.log(`Will process ${totalUnits} ${unitType}`);
// Pricing constants (as of March 2025, update as needed)
const pricing = {
// Get pricing based on vision provider
const pricing: {
vision: Record<string, Record<string, { input: number; output: number }>>;
tts: Record<string, Record<string, number>>;
} = {
vision: {
openai: {
'gpt-4o': {
input: 0.0025, // per 1K input tokens
output: 0.01 // per 1K output tokens
input: 0.0025,
output: 0.01
}
// Add other OpenAI models here
},
gemini: {
'gemini-pro-vision': {
input: 0.0025, // per 1K input tokens
output: 0.0025 // per 1K output tokens
input: 0.0025,
output: 0.0025
}
}
// Add other vision providers here
},
// Get pricing based on TTS provider
tts: {
openai: {
'tts-1': 0.015, // per 1K characters
'tts-1-hd': 0.030 // per 1K characters
'tts-1': 0.015,
'tts-1-hd': 0.030
}
// Add other TTS providers here
}
};