refactor: generic provider effort handling

This commit is contained in:
Simos Mikelatos
2026-06-30 23:56:01 +00:00
parent d618abb075
commit 0206a1f6aa
8 changed files with 188 additions and 164 deletions

View File

@@ -0,0 +1,12 @@
import type { LLMProvider, ProviderModelOption } from '../../../types/app';
export const DEFAULT_EFFORT_VALUE = 'default';
export const FALLBACK_PROVIDER_EFFORT_VALUES: Partial<Record<LLMProvider, readonly string[]>> = {
claude: ['low', 'medium', 'high', 'xhigh', 'max'],
codex: ['low', 'medium', 'high', 'xhigh'],
};
export const toProviderEffortOptions = (
values: readonly string[],
): NonNullable<ProviderModelOption['effort']>['values'] => values.map((value) => ({ value }));