Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/anthropic/actions/chat/chat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import constants from "../common/constants.mjs";

export default {
name: "Chat",
version: "0.0.10",
version: "0.1.0",
key: "anthropic-chat",
description: "The Chat API. [See the documentation](https://docs.anthropic.com/claude/reference/messages_post)",
type: "action",
props: {
anthropic,
model: {
label: "Model",
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 latest Claude model - [see the documentation](https://docs.anthropic.com/en/docs/about-claude/models/overview) for more information",
type: "string",
options: constants.MESSAGE_MODELS,
default: constants.MESSAGE_MODELS[0],
default: constants.MESSAGE_MODELS[0].value,
},
userMessage: {
label: "User Message",
Expand Down
43 changes: 36 additions & 7 deletions components/anthropic/actions/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
export default {
MESSAGE_MODELS: [
"claude-3-7-sonnet-20250219",
"claude-3-5-sonnet-20241022",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-20240620",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
{
label: "Claude Opus 4",
value: "claude-opus-4-20250514",
},
{
label: "Claude Sonnet 4",
value: "claude-sonnet-4-20250514",
},
Comment on lines +3 to +10
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.

{
label: "Claude Sonnet 3.7",
value: "claude-3-7-sonnet-20250219",
},
{
label: "Claude Sonnet 3.5 v2",
value: "claude-3-5-sonnet-20241022",
},
{
label: "Claude Haiku 3.5",
value: "claude-3-5-haiku-20241022",
},
{
label: "Claude Sonnet 3.5",
value: "claude-3-5-sonnet-20240620",
},
{
label: "Claude Opus 3",
value: "claude-3-opus-20240229",
},
{
label: "Claude Sonnet 3",
value: "claude-3-sonnet-20240229",
},
{
label: "Claude Haiku 3",
value: "claude-3-haiku-20240307",
},
],
};
2 changes: 1 addition & 1 deletion components/anthropic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/anthropic",
"version": "0.0.12",
"version": "0.1.0",
"description": "Pipedream Anthropic (Claude) Components",
"main": "anthropic.app.mjs",
"keywords": [
Expand Down
Loading