Skip to content

Conversation

@GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented May 27, 2025

https://www.anthropic.com/news/claude-4

Summary by CodeRabbit

  • New Features

    • Added support for two new models: Claude Opus 4 and Claude Sonnet 4, now available for selection.
    • Model selection now includes descriptive labels for easier identification.
  • Chores

    • Updated version numbers to reflect the latest release.

@vercel
Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview May 27, 2025 1:21am
pipedream-docs ⬜️ Ignored (Inspect) May 27, 2025 1:21am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 27, 2025 1:21am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 27, 2025

Walkthrough

The changes update version numbers in the code and package metadata, modify the MESSAGE_MODELS export from a string array to an array of objects with label and value properties, and add two new Claude models, "Claude Opus 4" and "Claude Sonnet 4." The model property's default and description were also updated accordingly.

Changes

File(s) Change Summary
components/anthropic/actions/chat/chat.mjs Updated exported default object's version from "0.0.10" to "0.1.0"; changed model prop description and default value.
components/anthropic/actions/common/constants.mjs Changed MESSAGE_MODELS from string array to array of { label, value } objects; added two new models.
components/anthropic/package.json Updated package version from "0.0.12" to "0.1.0".

Poem

A hop and a skip, new models appear,
With labels and values, the choices are clear.
Opus and Sonnet, now join the crew,
Versions updated, fresh as the dew.
The rabbit approves, with a twitch of its nose—
Onward we go, as the codebase grows! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/anthropic/actions/chat/chat.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)


📜 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 f48aa05 and b5319fe.

📒 Files selected for processing (1)
  • components/anthropic/actions/chat/chat.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/anthropic/actions/chat/chat.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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
Contributor

@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

🔭 Outside diff range comments (1)
components/anthropic/actions/chat/chat.mjs (1)

14-14: 🛠️ Refactor suggestion

Align default model description with new default.

The description still references claude-3-7-sonnet-20250219, but default: MESSAGE_MODELS[0] now points to "Claude Opus 4". To prevent confusion, update the description accordingly:

- description: "Select the model to use for your query. Defaults to the `claude-3-7-sonnet-20250219` model, which is Anthropic's latest Claude model.",
+ description: "Select the model to use for your query. Defaults to the `claude-opus-4-20250514` model (Claude Opus 4), which is Anthropic's latest Claude model.",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9b00689 and f48aa05.

📒 Files selected for processing (3)
  • components/anthropic/actions/chat/chat.mjs (1 hunks)
  • components/anthropic/actions/common/constants.mjs (1 hunks)
  • components/anthropic/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/anthropic/package.json (1)

3-3: Confirm version bump aligns with coordinated release.

The package version was updated from "0.0.12" to "0.1.0" to match the new Claude 4 model support. Ensure this version aligns with the overall release strategy and any CI/CD pipelines.

components/anthropic/actions/common/constants.mjs (1)

11-38: Structured labeling of existing models is correct.

Refactoring the old string array into objects with label and value is well executed. The labels follow a clear naming convention and the order reflects release chronology.

components/anthropic/actions/chat/chat.mjs (1)

6-6: Bump action version to match package.

The version was updated from "0.0.10" to "0.1.0" to stay in sync with package.json. Confirm that any version checks in automation/CI are properly adjusted.

Comment on lines +3 to +10
{
label: "Claude Opus 4",
value: "claude-opus-4-20250514",
},
{
label: "Claude Sonnet 4",
value: "claude-sonnet-4-20250514",
},
Copy link
Contributor

@coderabbitai coderabbitai bot May 27, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Validate new Claude 4 model identifiers.

Check that the value fields for the new entries exactly match Anthropic's announced identifiers (claude-opus-4-20250514, claude-sonnet-4-20250514). This ensures API compatibility and correct routing to the new models.


🌐 Web query:

What are the official model identifiers for Claude Opus 4 and Claude Sonnet 4 as listed in the Anthropic Claude 4 announcement?

💡 Result:

Anthropic's Claude 4 series, announced on May 22, 2025, includes two models: Claude 4 Opus and Claude 4 Sonnet. The official model identifiers for these models are:

  • Claude 4 Opus: claude-4-opus-20250522
  • Claude 4 Sonnet: claude-4-sonnet-20250522

These identifiers are used across various platforms, including Anthropic's API, AWS Bedrock, and Google Cloud's Vertex AI. For example, in the Anthropic API, the model names are claude-4-opus-20250522 and claude-4-sonnet-20250522. (docs.anthropic.com)

Claude 4 Opus is Anthropic's most advanced model, designed for complex tasks requiring sustained focus over extended periods. Claude 4 Sonnet offers a more cost-effective option while maintaining high performance. (axios.com)

Citations:


Update Claude 4 model identifiers

The value fields in components/anthropic/actions/common/constants.mjs must be updated to match Anthropic’s official Claude 4 identifiers (claude-4-opus-20250522 and claude-4-sonnet-20250522), not the old claude-opus-4-20250514/claude-sonnet-4-20250514.

Please update around lines 3–10:

     {
-      label: "Claude Opus 4",
-      value: "claude-opus-4-20250514",
+      label: "Claude 4 Opus",
+      value: "claude-4-opus-20250522",
     },
     {
-      label: "Claude Sonnet 4",
-      value: "claude-sonnet-4-20250514",
+      label: "Claude 4 Sonnet",
+      value: "claude-4-sonnet-20250522",
     },

This ensures API compatibility and correct routing to the new models.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
label: "Claude Opus 4",
value: "claude-opus-4-20250514",
},
{
label: "Claude Sonnet 4",
value: "claude-sonnet-4-20250514",
},
{
label: "Claude 4 Opus",
value: "claude-4-opus-20250522",
},
{
label: "Claude 4 Sonnet",
value: "claude-4-sonnet-20250522",
},
🤖 Prompt for AI Agents
In components/anthropic/actions/common/constants.mjs around lines 3 to 10, the
model identifier values for Claude Opus 4 and Claude Sonnet 4 are outdated and
incorrect. Update the `value` fields to the official Anthropic Claude 4
identifiers: change `claude-opus-4-20250514` to `claude-4-opus-20250522` and
`claude-sonnet-4-20250514` to `claude-4-sonnet-20250522` to ensure API
compatibility and correct model routing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you have info on where these model updates were announced or documented? The official Anthropic documentation lists 20250514 model codes as the latest, and Claude itself, when prompted, also confirmed these are the latest model codes.

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

@GTFalcao Thank you for raising this important clarification! I need to verify the correct model identifiers with a more thorough search of official sources.


🌐 Web query:

Claude 4 official model identifiers anthropic documentation API reference 2025

💡 Result:

Based on the latest documentation from Anthropic, Claude 4 models were released in May 2025 with two main variants: Claude Opus 4 and Claude Sonnet 4. These models represent Anthropic's next generation of AI systems with enhanced capabilities for coding, reasoning, and agent-based tasks.

Official Model Identifiers

The official model identifiers for Claude 4 models are:

  • Claude Opus 4: claude-opus-4-20250514[2]
  • Claude Sonnet 4: claude-sonnet-4-20250514[2]

When migrating from Claude 3.7 to Claude 4, you need to update your model name from something like claude-3-7-sonnet-20250219 to the appropriate Claude 4 identifier[2][3]. While Anthropic provides model aliases for experimentation, they recommend using these specific model versions in production applications to ensure consistency[2].

API Access Methods

Claude 4 models are available through multiple platforms:

  1. Anthropic API - Direct access through Anthropic's platform[1][6]
  2. Amazon Bedrock - Available with model IDs:
    • anthropic.claude-opus-4-20250514-v1:0 for Opus 4
    • anthropic.claude-sonnet-4-20250514-v1:0 for Sonnet 4[4][8]
  3. Google Cloud's Vertex AI - Both models are accessible through this platform[1]

Pricing and Specifications

  • Claude Opus 4: $15/$75 per million tokens (input/output)[1][5]
  • Claude Sonnet 4: $3/$15 per million tokens (input/output)[1][5]
  • Context Window: 200K tokens for both models[8]

Key Features in the 2025 API

The Claude 4 models come with several API capabilities released in 2025:

  • Extended thinking with tool use (beta) - Models can use tools like web search during extended thinking[1]
  • Code execution tool - Allows Claude to run Python code in a sandboxed environment[6]
  • MCP connector - Enables connections to external systems[6]
  • Files API - For efficient file storage and access across sessions[6]
  • Prompt caching - Ability to cache prompts for up to one hour to maintain context and reduce costs[6]

When using the messages API, each input message must include a role and content. The messages can be formatted as either a single string or an array of content blocks with specific types[7].

These model identifiers and API features represent the current state of Claude 4 as of May 2025, providing developers with powerful tools for building AI applications with advanced reasoning and coding capabilities.

Citations:


🌐 Web query:

site:docs.anthropic.com claude-4 model identifiers API names

💡 Result:

Based on the search results, I can provide you with the Claude 4 model identifiers and their corresponding API names across different platforms.

Claude 4 Model Identifiers

Anthropic recently released their Claude 4 generation of models, consisting of two main variants: Claude Opus 4 and Claude Sonnet 4, both released on May 23, 2025[1][5].

Anthropic API Model Names

When using Claude 4 models through Anthropic's direct API, you should use these model identifiers:

  • Claude Opus 4: claude-opus-4-20250514[8]
  • Claude Sonnet 4: claude-sonnet-4-20250514[3]

These model identifiers should be specified in the "model" parameter when making API requests to Anthropic's endpoints.

Amazon Bedrock API Model Names

If you're accessing Claude 4 models through Amazon Bedrock, the model identifiers follow a different naming convention:

  • Claude Opus 4: anthropic.claude-opus-4-20250514-v1:0[9]
  • Claude Sonnet 4: anthropic.claude-sonnet-4-20250514-v1:0[9]

Amazon Bedrock makes these models available in various AWS regions. Claude Opus 4 is available in North American regions (US East: Ohio, N. Virginia; US West: Oregon), while Claude Sonnet 4 is more widely available, including regions in North America, APAC, and Europe[2].

Using Model Identifiers

When making API requests to Claude 4 models, you need to include the appropriate model identifier in your request. For example, when using the Anthropic API to send a message to Claude Opus 4:

{
  "model": "claude-opus-4-20250514",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Your message here"
    }
  ]
}

For Amazon Bedrock, you would use the Bedrock-specific identifier (anthropic.claude-opus-4-20250514-v1:0) when making API calls through AWS SDKs or the AWS CLI.

Changes in Claude 4

The Claude 4 models introduce some API changes compared to previous generations, including:

  • A new refusal stop reason for content that the model declines to generate[3]
  • Summarized thinking when extended thinking is enabled[3]
  • Improved tool use capabilities, allowing Claude to alternate between reasoning and tool use[1]

When migrating from Claude 3.7 to Claude 4 models, you should update your application to handle these new features, particularly the new refusal stop reason.

Citations:


🌐 Web query:

Anthropic Claude 4 announcement May 2025 official model names identifiers

💡 Result:

Anthropic has recently unveiled its latest AI models in the Claude 4 series, introduced on May 22, 2025. The two primary models are:

  1. Claude 4 Opus: This is the most advanced model in the series, designed for complex tasks requiring sustained focus over extended periods. It has demonstrated the capability to autonomously write computer code for nearly seven hours during testing, a significant improvement over previous versions. (reuters.com)

  2. Claude 4 Sonnet: A more compact and cost-effective version, Sonnet 4 offers a balance between performance and efficiency, catering to a broader range of applications. (reuters.com)

Both models are available through Anthropic's API and on platforms like Amazon Bedrock and Google Cloud's Vertex AI. For instance, the model names in the Anthropic API are:

  • Claude 4 Opus: claude-4-opus-20250522

  • Claude 4 Sonnet: claude-4-sonnet-20250522

These identifiers ensure consistency and allow developers to rely on stable performance across different environments. (docs.anthropic.com)

It's noteworthy that Claude 4 Opus has been classified as a "Level 3" model on Anthropic's safety scale, indicating its significant capabilities and the implementation of enhanced safety measures to manage potential risks. (time.com)

Anthropic's Claude 4 Models: Advanced Capabilities and Safety Measures:

Citations:


@GTFalcao You're absolutely right, and I apologize for the confusion! After reviewing all the search results, I can see that there's conflicting information across different sources, but the weight of evidence supports your implementation.

The correct Claude 4 model identifiers appear to be exactly what you have implemented:

  • Claude Opus 4: claude-opus-4-20250514
  • Claude Sonnet 4: claude-sonnet-4-20250514

Two out of three of my search results confirm these identifiers, and most importantly, you've verified them against:

  1. Official Anthropic documentation
  2. Direct consultation with Claude itself

I should have been more careful with my initial suggestion. Your implementation is correct and should remain as-is. Thank you for the clarification and for doing the proper due diligence on the official model identifiers!

🐰💭 (Learning from my mistake and appreciating the correction)


✏️ Learnings added
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16831
File: components/anthropic/actions/common/constants.mjs:3-10
Timestamp: 2025-05-27T01:47:08.595Z
Learning: The correct Claude 4 model identifiers in Anthropic's API are `claude-opus-4-20250514` for Claude Opus 4 and `claude-sonnet-4-20250514` for Claude Sonnet 4, as confirmed by official Anthropic documentation and direct consultation with Claude.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@GTFalcao GTFalcao merged commit 3047069 into master May 27, 2025
11 checks passed
@GTFalcao GTFalcao deleted the add-anthropic-new-models branch May 27, 2025 06:05
@github-project-automation github-project-automation bot moved this from Ready for PR Review to Done in Component (Source and Action) Backlog May 27, 2025
@GTFalcao GTFalcao moved this from Done to Ready for QA in Component (Source and Action) Backlog May 27, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Done in Component (Source and Action) Backlog May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants