Refactors Anthropic model type and list handling
Removes strict type definition for Anthropic models to enable more dynamic model selection Allows for flexible model ID fetching from Anthropic API Provides a fallback list of models when direct API access is limited Supports more adaptable model configuration in the application
This commit is contained in:
2 files changed
+4
-5
No files matched your search
@@ -75,7 +75,7 @@ Settings use the `FreewritingCleanupSettings` interface with modular defaults:
|
|||||||
```typescript
|
```typescript
|
||||||
interface FreewritingCleanupSettings {
|
interface FreewritingCleanupSettings {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
model: AnthropicModel;
|
model: string; // Dynamic model ID fetched from Anthropic API
|
||||||
cleanupPrompt: string;
|
cleanupPrompt: string;
|
||||||
enableCommentary: boolean;
|
enableCommentary: boolean;
|
||||||
commentaryStyle: CommentaryStyle;
|
commentaryStyle: CommentaryStyle;
|
||||||
|
|||||||
@@ -80,16 +80,15 @@ export interface ModelCache {
|
|||||||
fetchedAt: number;
|
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-1-20250805',
|
||||||
'claude-opus-4-20250514',
|
'claude-opus-4-20250514',
|
||||||
'claude-sonnet-4-20250514',
|
'claude-sonnet-4-20250514',
|
||||||
'claude-3-7-sonnet-latest',
|
'claude-3-7-sonnet-latest',
|
||||||
'claude-3-5-haiku-latest',
|
'claude-3-5-haiku-latest',
|
||||||
'claude-3-haiku-20240307'
|
'claude-3-haiku-20240307'
|
||||||
] as const;
|
];
|
||||||
|
|
||||||
export type AnthropicModel = typeof ANTHROPIC_MODELS[number];
|
|
||||||
|
|
||||||
// Commentary style options
|
// Commentary style options
|
||||||
export const COMMENTARY_STYLES = [
|
export const COMMENTARY_STYLES = [
|
||||||
|
|||||||
Reference in new issue
Block a user