Initialize Anthropic models.
(self)
| 538 | await self._create_client(config) |
| 539 | |
| 540 | async def _initialize_anthropic_models(self): |
| 541 | """Initialize Anthropic models.""" |
| 542 | chat_models = [ |
| 543 | # Note: Claude 3.5 Sonnet is deprecated, use Claude 3.7 Sonnet or Claude Sonnet 4.5 instead |
| 544 | # { |
| 545 | # "model_name": "anthropic/claude-sonnet-3.5", |
| 546 | # "model_id": "claude-3-5-sonnet-20240620", |
| 547 | # "model_type": "chat/completions", |
| 548 | # "temperature": self.default_temperature, |
| 549 | # "max_completion_tokens": self.max_tokens, |
| 550 | # "fallback_model": "anthropic/claude-sonnet-4.5", |
| 551 | # }, |
| 552 | { |
| 553 | "model_name": "anthropic/claude-sonnet-3.7", |
| 554 | "model_id": "claude-3-7-sonnet-20250219", # Anthropic model ID with version |
| 555 | "model_type": "chat/completions", |
| 556 | "temperature": self.default_temperature, |
| 557 | "max_completion_tokens": self.max_tokens, |
| 558 | "fallback_model": "anthropic/claude-sonnet-4.5", |
| 559 | }, |
| 560 | { |
| 561 | "model_name": "anthropic/claude-sonnet-4", |
| 562 | "model_id": "claude-sonnet-4-20250514", # Anthropic model ID with version |
| 563 | "model_type": "chat/completions", |
| 564 | "temperature": self.default_temperature, |
| 565 | "max_completion_tokens": self.max_tokens, |
| 566 | "fallback_model": "anthropic/claude-sonnet-4.5", |
| 567 | }, |
| 568 | # { |
| 569 | # "model_name": "anthropic/claude-opus-4", |
| 570 | # "model_id": "claude-opus-4-20250514", # Anthropic model ID with version |
| 571 | # "model_type": "chat/completions", |
| 572 | # "temperature": self.default_temperature, |
| 573 | # "max_completion_tokens": self.max_tokens, |
| 574 | # "fallback_model": "anthropic/claude-sonnet-4.5", |
| 575 | # }, |
| 576 | { |
| 577 | "model_name": "anthropic/claude-sonnet-4.5", |
| 578 | "model_id": "claude-sonnet-4-5-20250929", # Anthropic model ID with version |
| 579 | "model_type": "chat/completions", |
| 580 | "temperature": self.default_temperature, |
| 581 | "max_completion_tokens": self.max_tokens, |
| 582 | "fallback_model": "anthropic/claude-sonnet-4.5", |
| 583 | }, |
| 584 | # { |
| 585 | # "model_name": "anthropic/claude-opus-4.5", |
| 586 | # "model_id": "claude-opus-4-1-20250805", # Correct Anthropic model ID (Opus 4.1) |
| 587 | # "model_type": "chat/completions", |
| 588 | # "temperature": self.default_temperature, |
| 589 | # "max_completion_tokens": self.max_tokens, |
| 590 | # "fallback_model": "anthropic/claude-sonnet-4.5", |
| 591 | # }, |
| 592 | ] |
| 593 | |
| 594 | # Register Anthropic models |
| 595 | for model in chat_models: |
| 596 | config = ModelConfig( |
| 597 | model_name=model["model_name"], |
no test coverage detected