Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New model Sonnet 3.7 #54

Merged
merged 4 commits into from
Feb 24, 2025
Merged

feat: New model Sonnet 3.7 #54

merged 4 commits into from
Feb 24, 2025

Conversation

ospar0829
Copy link
Contributor

@ospar0829 ospar0829 commented Feb 24, 2025

This pull request is related to:

  • A bug
  • A new feature
  • Documentation
  • Other (please specify)

I have checked the following:

  • I have read and understood the contribution guidelines and the code of conduct;
  • I have added new tests (for bug fixes/features);
  • I have added/updated the documentation (for bug fixes / features).

Description:
New model: Anthropic Sonnet 3.7

Summary by CodeRabbit

  • New Features
    • Added support for the Anthropic - Claude 3.7 Sonnet V1 model, expanding the range of models available.
    • The new model is dynamically configurable based on the inference region, providing a tailored experience for users.
    • Enhanced interaction capabilities and diverse output options are included, offering a more flexible experience.

@ospar0829 ospar0829 requested a review from xavidop as a code owner February 24, 2025 21:55
Copy link

coderabbitai bot commented Feb 24, 2025

Walkthrough

A new function anthropicClaude37SonnetV1 is added in src/aws_bedrock_llms.ts, which uses an optional inferenceRegion parameter (defaulting to "us") to generate a dynamic model reference using the modelRef function. The corresponding model entry is now included in SUPPORTED_AWS_BEDROCK_MODELS. Additionally, this new model function is exported in src/index.ts, integrating it with the public API of the project.

Changes

File(s) Change Summary
src/aws_bedrock_llms.ts Added the anthropicClaude37SonnetV1 function with an optional inferenceRegion parameter and integrated it into SUPPORTED_AWS_BEDROCK_MODELS.
src/index.ts New export added for anthropicClaude37SonnetV1 to include it as part of the public API.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as User/Caller
    participant ACls as anthropicClaude37SonnetV1
    participant ModelRef as modelRef Function

    Caller->>ACls: Call anthropicClaude37SonnetV1(inferenceRegion)
    ACls->>ModelRef: Generate model reference using inferenceRegion
    ModelRef-->>ACls: Return ModelReference object
    ACls-->>Caller: Return constructed ModelReference
Loading

Poem

I’m a rabbit in the code field, hopping through the line,
Adding a model so fine, making everything align.
With regions as my guide, my function springs to life,
In files and exports, cutting through the strife.
Hop along, dear coder—this update’s a joyful rhyme!
🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba7ba4c and 40be01f.

📒 Files selected for processing (1)
  • src/index.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/index.ts

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcc8329 and ba7ba4c.

📒 Files selected for processing (2)
  • src/aws_bedrock_llms.ts (2 hunks)
  • src/index.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Check: build-and-test (20.x)
src/index.ts

[failure] 88-88:
Cannot find name 'anthropicClaude37SonnetV1'. Did you mean 'anthropicClaude3SonnetV1'?

🪛 GitHub Actions: Build & Test
src/index.ts

[error] 88-88: error TS2552: Cannot find name 'anthropicClaude37SonnetV1'. Did you mean 'anthropicClaude3SonnetV1'?

🔇 Additional comments (2)
src/aws_bedrock_llms.ts (1)

769-770: LGTM!

The new model is correctly added to the supported models map, following the established pattern and maintaining alphabetical order.

src/index.ts (1)

88-88: ⚠️ Potential issue

Fix the missing import.

The export is added but the import is missing, causing build failures. Add the import to fix the error.

Apply this diff to fix the import:

import {
  awsBedrockModel,
  amazonNovaProV1,
  ...
  anthropicClaude35HaikuV1,
+ anthropicClaude37SonnetV1,
  anthropicClaude35SonnetV2,
  ...
} from "./aws_bedrock_llms.js";

Likely an incorrect or invalid review comment.

🧰 Tools
🪛 GitHub Check: build-and-test (20.x)

[failure] 88-88:
Cannot find name 'anthropicClaude37SonnetV1'. Did you mean 'anthropicClaude3SonnetV1'?

🪛 GitHub Actions: Build & Test

[error] 88-88: error TS2552: Cannot find name 'anthropicClaude37SonnetV1'. Did you mean 'anthropicClaude3SonnetV1'?

Comment on lines +275 to +295
export const anthropicClaude37SonnetV1 = (
inferenceRegion: string = "us",
): ModelReference<typeof GenerationCommonConfigSchema> => {
return modelRef({
name: `aws-bedrock/${inferenceRegion}.anthropic.claude-3-7-sonnet-20250219-v1:0`,
info: {
versions: [
`${inferenceRegion}.anthropic.claude-3-7-sonnet-20250219-v1:0`,
],
label: "Anthropic - Claude 3.7 Sonnet V1",
supports: {
multiturn: true,
tools: true,
media: true,
systemRole: true,
output: ["text", "json"],
},
},
configSchema: GenerationCommonConfigSchema,
});
};
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

⚠️ Potential issue

🧩 Analysis chain

Verify the model version date.

The model version includes a future date "20250219" which seems incorrect. Please verify if this is the correct version identifier for the Claude 3.7 Sonnet model.


🌐 Web query:

What is the latest version of Claude 3.7 Sonnet?

💡 Result:

Claude 3.7 Sonnet is Anthropic's latest AI model as of February 24, 2025[1][5][10]. This first-of-its-kind hybrid reasoning model combines rapid responses with extended analytical capabilities in a single system[1][6][7]. Key features include:

Two operational modes:

  • Standard mode: Functions as an enhanced version of Claude 3.5 Sonnet for quick responses[1][5]
  • Extended thinking mode: Enables detailed problem-solving through self-reflection and step-by-step reasoning[1][3][6]

Technical advancements:

  • Supports outputs up to 128K tokens (beta) - a 15x increase from previous versions[1][10]
  • Maintains pricing at $3/million input tokens and $15/million output tokens[4][6]
  • Achieves 70.3% accuracy on SWE-bench Verified coding tasks in standard mode[1][6]

The model is currently available through:

  • Amazon Bedrock in US regions[1][5]
  • Google Cloud's Vertex AI (preview)[8]
  • Anthropic API[9]
  • Integrated into Amazon Q Developer for coding workflows[1]

No newer versions beyond Claude 3.7 Sonnet appear in any official announcements or technical documentation as of this date[1][4][10].

Citations:


Action Required: Update the Model Version Date Identifier

The current version identifier uses the date "20250219", but recent official sources confirm that Claude 3.7 Sonnet was released on February 24, 2025. Please update the version string in src/aws_bedrock_llms.ts (lines 275–295) accordingly.

  • File: src/aws_bedrock_llms.ts
  • Location: Lines 275–295
  • Correction: Change "20250219" to "20250224" in the model reference (both in the name and within the versions array).

@xavidop xavidop changed the title New model Sonnet 3.7 feat: New model Sonnet 3.7 Feb 24, 2025
Copy link
Owner

@xavidop xavidop left a comment

Choose a reason for hiding this comment

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

Build is failing, you need to import the model to export it in index.ts

@xavidop xavidop merged commit 4b37211 into xavidop:main Feb 24, 2025
5 checks passed
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants