1212class Anthropic extends Adapter
1313{
1414 /**
15- * Claude 3 Opus - Most powerful model for highly complex tasks
15+ * Claude 4 Opus - Flagship model with exceptional reasoning for the most demanding tasks
1616 */
17- public const MODEL_CLAUDE_3_OPUS = 'claude-3- opus-20240229 ' ;
17+ public const MODEL_CLAUDE_4_OPUS = 'claude-opus-4-0 ' ;
1818
1919 /**
20- * Claude 3 Sonnet - Ideal balance of intelligence and speed
20+ * Claude 3 Opus - Premium model with superior performance on complex analysis and creative work
2121 */
22- public const MODEL_CLAUDE_3_SONNET = 'claude-3-7-sonnet-20250219 ' ;
22+ public const MODEL_CLAUDE_3_OPUS = 'claude-3-opus-latest ' ;
2323
2424 /**
25- * Claude 3 Haiku - Fastest and most compact model
25+ * Claude 4 Sonnet - Intelligent and responsive model optimized for productivity workflows
2626 */
27- public const MODEL_CLAUDE_3_HAIKU = 'claude-3-haiku-20240229 ' ;
27+ public const MODEL_CLAUDE_4_SONNET = 'claude-sonnet-4-0 ' ;
2828
2929 /**
30- * Claude 2.1 - Previous generation model
30+ * Claude 3.7 Sonnet - Enhanced model with improved reasoning and coding capabilities
3131 */
32- public const MODEL_CLAUDE_2_1 = 'claude-2.1 ' ;
32+ public const MODEL_CLAUDE_3_7_SONNET = 'claude-3-7-sonnet-latest ' ;
33+
34+ /**
35+ * Claude 3.5 Sonnet - Versatile model balancing capability and speed for general use
36+ */
37+ public const MODEL_CLAUDE_3_5_SONNET = 'claude-3-5-sonnet-latest ' ;
38+
39+ /**
40+ * Claude 3.5 Haiku - Ultra-fast model for quick responses and lightweight processing
41+ */
42+ public const MODEL_CLAUDE_3_5_HAIKU = 'claude-3-5-haiku-latest ' ;
43+
44+ /**
45+ * Claude 3 Haiku - Rapid model designed for speed and efficiency on straightforward tasks
46+ */
47+ public const MODEL_CLAUDE_3_HAIKU = 'claude-3-haiku-20240307 ' ;
3348
3449 /**
3550 * Cache TTL for 3600 seconds
@@ -74,7 +89,7 @@ class Anthropic extends Adapter
7489 */
7590 public function __construct (
7691 string $ apiKey ,
77- string $ model = self ::MODEL_CLAUDE_3_SONNET ,
92+ string $ model = self ::MODEL_CLAUDE_3_HAIKU ,
7893 int $ maxTokens = 1024 ,
7994 float $ temperature = 1.0 ,
8095 int $ timeout = 90
@@ -356,10 +371,13 @@ protected function process(Chunk $chunk, ?callable $listener): string
356371 public function getModels (): array
357372 {
358373 return [
374+ self ::MODEL_CLAUDE_4_OPUS ,
359375 self ::MODEL_CLAUDE_3_OPUS ,
360- self ::MODEL_CLAUDE_3_SONNET ,
376+ self ::MODEL_CLAUDE_4_SONNET ,
377+ self ::MODEL_CLAUDE_3_7_SONNET ,
378+ self ::MODEL_CLAUDE_3_5_SONNET ,
379+ self ::MODEL_CLAUDE_3_5_HAIKU ,
361380 self ::MODEL_CLAUDE_3_HAIKU ,
362- self ::MODEL_CLAUDE_2_1 ,
363381 ];
364382 }
365383
@@ -378,15 +396,9 @@ public function getModel(): string
378396 *
379397 * @param string $model
380398 * @return self
381- *
382- * @throws \Exception
383399 */
384400 public function setModel (string $ model ): self
385401 {
386- if (! in_array ($ model , $ this ->getModels ())) {
387- throw new \Exception ('Unsupported model: ' .$ model );
388- }
389-
390402 $ this ->model = $ model ;
391403
392404 return $ this ;
0 commit comments