Refines Anthropic model type and list definitions

Updates model type to use ModelId type for stronger type safety

Improves hardcoded model list with TODO for keeping it current
Removes outdated comments and simplifies model list annotations

Prepares for more dynamic model handling with explicit update guidance
This commit is contained in:
AlexKucera committed 2025-10-24 16:53:06 +02:00
1 parent ea14071d22
commit 902d2b1b9a
1 file changed
+7 -9
+7 -9
View File
@@ -56,7 +56,7 @@ export interface AnthropicMessage {
*/
export interface AnthropicRequest {
/** Model identifier (e.g., 'claude-3-5-haiku-latest') */
model: string;
model: ModelId;
/** Maximum number of tokens to generate in the response */
max_tokens: number;
/** Array of conversation messages between user and assistant */
@@ -153,20 +153,18 @@ export interface ModelCache {
/**
* Hardcoded fallback list of known Claude models.
* Used when the Models API is unavailable or the API key is not configured.
* This list should be updated periodically as new models are released.
*
* Organized by family (newest to oldest):
* - Sonnet 4.5 (latest, released Sept 29, 2025)
* - Haiku 4.5 (released Oct 1, 2025)
* - Opus 4.1 (released Aug 5, 2025)
* - Legacy models (Sonnet 4, 3.7, Opus 4, Haiku 3.5, Haiku 3)
* TODO: Keep this list updated with current models from:
* https://docs.anthropic.com/en/docs/about-claude/models
*
* Prefer "-latest" aliases where available for automatic updates.
*/
export const ANTHROPIC_MODELS = [
// Current Models (using -latest aliases for stability)
// Current generation models (use -latest aliases where available)
'claude-sonnet-4-5-20250929',
'claude-haiku-4-5-20251001',
'claude-opus-4-1-20250805',
// Legacy Models
// Legacy models
'claude-sonnet-4-20250514',
'claude-3-7-sonnet-latest',
'claude-opus-4-20250514',