feat: add dynamic model fetching from Anthropic API #2

Merged
AlexKucera merged 10 commits from dynamic-models into master 2025-10-24 11:14:13 +02:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit b63ab214b3 - Show all commits

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ Settings use the `FreewritingCleanupSettings` interface with modular defaults:
```typescript
interface FreewritingCleanupSettings {
apiKey: string;
model: AnthropicModel;
model: string; // Dynamic model ID fetched from Anthropic API
cleanupPrompt: string;
enableCommentary: boolean;
commentaryStyle: CommentaryStyle;
+3 -4
View File
@@ -80,16 +80,15 @@ export interface ModelCache {
fetchedAt: number;
}
export const ANTHROPIC_MODELS = [
// Fallback model list used when API key is not set or API fetch fails
export const ANTHROPIC_MODELS: readonly string[] = [
'claude-opus-4-1-20250805',
'claude-opus-4-20250514',
'claude-sonnet-4-20250514',
'claude-3-7-sonnet-latest',
'claude-3-5-haiku-latest',
'claude-3-haiku-20240307'
] as const;
export type AnthropicModel = typeof ANTHROPIC_MODELS[number];
];
// Commentary style options
export const COMMENTARY_STYLES = [
1