Modernize codebase
This commit is contained in:
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user