Skip to content

Commit

Permalink
Add --model option to improve-subtitle script
Browse files Browse the repository at this point in the history
Allow specifying which model to use (gemini or claude) when improving subtitles, defaulting to gemini.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: claude-for-github[bot] <177261773+claude-for-github[bot]@users.noreply.github.com>
  • Loading branch information
dtinth and claude-for-github[bot] committed Mar 3, 2025
1 parent 3311af1 commit c283ab8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/scripts/improve-subtitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const argv = await yargs(process.argv.slice(2))
type: 'string',
demandOption: true,
})
.option('model', {
describe: 'Model to use for improving subtitles (gemini, claude)',
type: 'string',
choices: ['gemini', 'claude'],
default: 'gemini',
})
.option('skip', {
describe: 'Skip first N segments',
type: 'number',
Expand Down Expand Up @@ -81,14 +87,8 @@ function vttToJsonObject(vtt: string) {
return { segments, cueToIds, parsed }
}

// Initialize Anthropic client
if (!process.env.ANTHROPIC_API_KEY) {
throw new Error('ANTHROPIC_API_KEY environment variable is required')
}

const modelProvider: string = 'google'
const model =
modelProvider === 'google'
argv.model === 'gemini'
? google('gemini-2.0-flash-exp')
: anthropic('claude-3-7-sonnet-20250219')

Expand Down

0 comments on commit c283ab8

Please sign in to comment.