Skip to content

Commit

Permalink
add: check for supported models when using prompt caching
Browse files Browse the repository at this point in the history
  • Loading branch information
gmickel committed Aug 16, 2024
1 parent f938229 commit 8568f6b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export function cli(_args: string[]) {
.command('task')
.description('Start an AI-assisted coding task')
.option('-p, --path <path>', 'Path to the codebase', '.')
.option('-m, --model <modelId>', 'Specify the AI model to use')
.option(
'-m, --model <modelId>',
'Specify the AI model to use',
'claude-3-5-sonnet-20240620',
)
.option(
'-c, --context <paths...>',
'Specify files or directories to include in the task context. Can be file paths, directory paths, or glob patterns. Multiple entries should be space-separated.',
Expand Down Expand Up @@ -167,6 +171,19 @@ Note: see "query parameters" at https://docs.github.com/en/rest/issues/issues?ap
);
process.exit(1);
}
if (
options.promptCache &&
(!options.model ||
(!options.model.includes('claude-3-5-sonnet') &&
!options.model.includes('claude-3-haiku')))
) {
console.error(
chalk.red(
'Error: --prompt-cache is only available for Claude-3.5 Sonnet and Claude-3 Haiku models',
),
);
process.exit(1);
}

if (options.redo) {
try {
Expand Down

0 comments on commit 8568f6b

Please sign in to comment.