-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Adding new Claude models to Anthropic app #16831
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe changes update version numbers in the code and package metadata, modify the Changes
Poem
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
components/anthropic/actions/chat/chat.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 suggestionAlign default model description with new default.
The
descriptionstill referencesclaude-3-7-sonnet-20250219, butdefault: 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
📒 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
labelandvalueis 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
versionwas updated from "0.0.10" to "0.1.0" to stay in sync withpackage.json. Confirm that any version checks in automation/CI are properly adjusted.
| { | ||
| label: "Claude Opus 4", | ||
| value: "claude-opus-4-20250514", | ||
| }, | ||
| { | ||
| label: "Claude Sonnet 4", | ||
| value: "claude-sonnet-4-20250514", | ||
| }, |
There was a problem hiding this comment.
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:
- 1: https://docs.anthropic.com/en/docs/about-claude/models/all-models?utm_source=openai
- 2: https://www.axios.com/2025/05/22/anthropic-claude-version-4-ai-model?utm_source=openai
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.
| { | |
| 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- Anthropic API - Direct access through Anthropic's platform[1][6]
- Amazon Bedrock - Available with model IDs:
anthropic.claude-opus-4-20250514-v1:0for Opus 4anthropic.claude-sonnet-4-20250514-v1:0for Sonnet 4[4][8]
- 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:
- 1: https://www.anthropic.com/news/claude-4
- 2: https://docs.anthropic.com/en/docs/about-claude/models/overview
- 3: https://docs.anthropic.com/en/docs/about-claude/models/migrating-to-claude-4
- 4: https://aws.amazon.com/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/
- 5: https://techcrunch.com/2025/05/22/anthropics-new-claude-4-ai-models-can-reason-over-many-steps/
- 6: https://anthropic.com/news/agent-capabilities-api
- 7: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html
- 8: https://www.aboutamazon.com/news/aws/anthropic-claude-4-opus-sonnet-amazon-bedrock
- 9: https://docs.anthropic.com/en/release-notes/api
- 10: https://apidog.com/blog/claude-opus-4-sonnet-4-api/
🌐 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
refusalstop 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:
- 1: https://www.anthropic.com/news/claude-4
- 2: https://aws.amazon.com/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/
- 3: https://docs.anthropic.com/en/docs/about-claude/models/migrating-to-claude-4
- 4: https://anthropic.com/model-card
- 5: https://www.aboutamazon.com/news/aws/anthropic-claude-4-opus-sonnet-amazon-bedrock
- 6: https://docs.anthropic.com/en/api/models
- 7: https://docs.anthropic.com/en/docs/about-claude/models
- 8: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview
- 9: https://docs.anthropic.com/en/api/claude-on-amazon-bedrock
- 10: https://docs.anthropic.com/en/api/models-list
🌐 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:
-
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)
-
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:
- Anthropic unveils the latest Claudes with claim to AI coding crown
- Exclusive: New Claude Model Triggers Stricter Safeguards at Anthropic
- Startup Anthropic says its new AI model can code for hours at a time
Citations:
- 1: https://www.reuters.com/business/startup-anthropic-says-its-new-ai-model-can-code-hours-time-2025-05-22/?utm_source=openai
- 2: https://www.reuters.com/business/startup-anthropic-says-its-new-ai-model-can-code-hours-time-2025-05-22/?utm_source=openai
- 3: https://docs.anthropic.com/en/docs/about-claude/models/all-models?utm_source=openai
- 4: https://time.com/7287806/anthropic-claude-4-opus-safety-bio-risk/?utm_source=openai
- 5: https://www.axios.com/2025/05/22/anthropic-claude-version-4-ai-model?utm_source=openai
- 6: https://time.com/7287806/anthropic-claude-4-opus-safety-bio-risk/?utm_source=openai
- 7: https://www.reuters.com/business/startup-anthropic-says-its-new-ai-model-can-code-hours-time-2025-05-22/?utm_source=openai
@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:
- Official Anthropic documentation
- 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.
https://www.anthropic.com/news/claude-4
Summary by CodeRabbit
New Features
Chores