Skip to content

feat: add new claude models#241

Merged
jalmonter merged 4 commits into
mainfrom
add-claude
May 23, 2025
Merged

feat: add new claude models#241
jalmonter merged 4 commits into
mainfrom
add-claude

Conversation

@Lavriz
Copy link
Copy Markdown
Contributor

@Lavriz Lavriz commented May 22, 2025

@Lavriz Lavriz self-assigned this May 22, 2025
@Lavriz
Copy link
Copy Markdown
Contributor Author

Lavriz commented May 22, 2025

i might miss smth from the docs, sorry, just got it: https://docs.anthropic.com/en/docs/about-claude/models/migrating-to-claude-4

@evgenydmitriev
Copy link
Copy Markdown
Contributor

Let's have Claude review this.

@evgenydmitriev evgenydmitriev requested a review from Copilot May 22, 2025 19:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for the new Claude 4 Sonnet and Opus models by extending the ModelName enum and updating the Anthropic provider’s default and supported models.

  • Introduce Claude_4_Sonnet and Claude_4_Opus in ModelName
  • Set Claude_4_Sonnet as the default for Anthropic and expand its models list
Comments suppressed due to low confidence (1)

src/providers/index.ts:18

  • The string literal here reverses the established pattern (claude-<version>-<name>-<date>). Consider renaming to 'claude-4-sonnet-20250514' (and similarly for Opus) to keep consistency with other enum entries.
Claude_4_Sonnet = 'claude-sonnet-4-20250514',

Comment thread src/providers/index.ts Outdated
@evgenydmitriev
Copy link
Copy Markdown
Contributor

@claude review this PR

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2025

Claude finished @evgenydmitriev's task —— View job


Code Review: feat: add new claude models

Todo List:

  • Read the changed file (src/providers/index.ts) to understand the modifications
  • Check for any related files that define model names or types
  • Analyze the implementation for correctness and completeness
  • Verify copilot reviewer's feedback about duplicates and missing models
  • Provide comprehensive review feedback

Review Summary

I've reviewed the changes in src/providers/index.ts and can confirm that Copilot's feedback is accurate. The PR requires fixes before merging.

❌ Critical Issues

1. Duplicate Model Entry (Line 47)

models: [ModelName.Claude_4_Opus, ModelName.Claude_3_7_Sonnet_20250219, ModelName.Claude_3_5_Sonnet_20241022, ModelName.Claude_3_7_Sonnet_20250219, ModelName.Claude_3_7_Sonnet_20250219_Thinking],

ModelName.Claude_3_7_Sonnet_20250219 appears twice in the array. Remove one occurrence.

2. Missing Default Model (Line 47)
ModelName.Claude_4_Sonnet is set as the default on line 46, but it's missing from the models array. This will cause runtime errors when the system tries to validate the default model.

✅ Recommended Fix

Update line 47 to:

models: [ModelName.Claude_4_Opus, ModelName.Claude_4_Sonnet, ModelName.Claude_3_7_Sonnet_20250219, ModelName.Claude_3_5_Sonnet_20241022, ModelName.Claude_3_7_Sonnet_20250219_Thinking],

✅ Positive Changes

  • New Claude 4 models are properly defined in the ModelName enum (lines 18-19)
  • Model name strings follow the correct naming convention
  • The default model is correctly set to ModelName.Claude_4_Sonnet (line 46)

🔍 Additional Considerations

  • The model identifiers (claude-sonnet-4-20250514, claude-opus-4-20250514) appear to follow Anthropic's new naming convention
  • Consider verifying these model names match the official Anthropic API documentation

Status:Changes Requested - Please fix the duplicate entry and add the missing Claude_4_Sonnet model to the array.


@evgenydmitriev
Copy link
Copy Markdown
Contributor

@claude implement needed changes:

  1. remove duplicate model entry
  2. default model should be Claude_4_Opus
  3. remove all Anthropic model mentions apart from the Claude 4 models
  4. update documentation to reflect the changes

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2025

Claude finished @evgenydmitriev's task —— View job


✅ Implementation Complete

Todo List:

  • Read CLAUDE.md for repo-specific guidelines (no CLAUDE.md found)
  • Read current state of src/providers/index.ts
  • Remove duplicate Claude_3_7_Sonnet_20250219 entry
  • Change default model to Claude_4_Opus
  • Remove all non-Claude-4 Anthropic models from the models array
  • Remove old Claude 3 model enum entries that are no longer used
  • Search for documentation files that need updates
  • Update documentation to reflect changes (updated README.md)
  • Commit all changes to the branch

Summary of Changes

I've successfully implemented all the requested changes:

  1. ✅ Removed duplicate model entry: Fixed the duplicate Claude_3_7_Sonnet_20250219 in the models array
  2. ✅ Changed default model: Updated default from Claude_4_Sonnet to Claude_4_Opus
  3. ✅ Removed old Anthropic models: Kept only Claude 4 models (Claude_4_Opus, Claude_4_Sonnet)
  4. ✅ Updated documentation: Updated README.md to reflect the new Claude 4 model names

Files modified:

  • src/providers/index.ts - Updated model configuration and removed legacy enum entries
  • README.md - Updated Available Models section

Commit: 42ce63c

The PR is now ready for review with only Claude 4 models available for the Anthropic provider.


- Set Claude_4_Opus as default Anthropic model
- Remove duplicate model entries
- Keep only Claude 4 models (Claude_4_Opus, Claude_4_Sonnet)
- Remove legacy Claude 3 model enum entries
- Update README.md documentation to reflect new model list

Co-authored-by: evgenydmitriev <evgenydmitriev@users.noreply.github.com>
@jalmonter jalmonter merged commit 957eb7c into main May 23, 2025
4 checks passed
@jalmonter jalmonter deleted the add-claude branch May 23, 2025 04:13
@Kseymur
Copy link
Copy Markdown

Kseymur commented May 24, 2025

1712n/dedup-service#7 (comment)

it looks like the fallback model was used instead of claude-opus-4-20250514

@Lavriz Lavriz mentioned this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants