Skip to content

feat(anthropic): add model metadata for Claude Opus 4.1#9347

Merged
jordanrfrazier merged 2 commits intolangflow-ai:mainfrom
philnash:claude-opus-4-1
Oct 2, 2025
Merged

feat(anthropic): add model metadata for Claude Opus 4.1#9347
jordanrfrazier merged 2 commits intolangflow-ai:mainfrom
philnash:claude-opus-4-1

Conversation

@philnash
Copy link
Member

@philnash philnash commented Aug 11, 2025

Summary by CodeRabbit

  • New Features
    • Added support for Anthropic “Claude Opus 4.1 (2025-08-05)” with tool-calling enabled.
    • The model now appears in selection lists and can invoke tools/functions where supported.
    • Expands the available set of tool-calling models for workflows and automations.
    • No changes to deprecated or unsupported model lists; existing behavior remains unchanged.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Added a new Anthropic tool-calling model entry (claude-opus-4-1-20250805) to ANTHROPIC_MODELS_DETAILED in anthropic_constants.py. This inclusion updates the derived model lists that reference ANTHROPIC_MODELS_DETAILED; no other logic or error handling was modified.

Changes

Cohort / File(s) Summary of Changes
Anthropic model metadata
src/backend/base/langflow/base/models/anthropic_constants.py
Inserted model metadata entry for claude-opus-4-1-20250805 with tool_calling=True under “Tool calling supported models”. Derived lists will now include this model.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • edwinjosechittilappilly
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the enhancement New feature or request label Aug 11, 2025
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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b093c1f and e37afa5.

📒 Files selected for processing (1)
  • src/backend/base/langflow/base/models/anthropic_constants.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • src/backend/base/langflow/base/models/anthropic_constants.py
🧬 Code Graph Analysis (1)
src/backend/base/langflow/base/models/anthropic_constants.py (1)
src/backend/base/langflow/base/models/model_metadata.py (1)
  • create_model_metadata (18-41)
🔇 Additional comments (1)
src/backend/base/langflow/base/models/anthropic_constants.py (1)

5-5: Claude Opus 4.1 metadata addition looks consistent

Provider/name/icon/flag follow existing conventions for tool-calling Anthropic models.

@@ -2,6 +2,7 @@

ANTHROPIC_MODELS_DETAILED = [
# Tool calling supported models
create_model_metadata(provider="Anthropic", name="claude-opus-4-1-20250805", icon="Anthropic", tool_calling=True),
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify provider model ID and be mindful of ordering side-effects

  • Double-check the official Anthropic model ID string; ensure "claude-opus-4-1-20250805" is correct.
  • Placing this at the top changes the order in ANTHROPIC_MODELS and TOOL_CALLING_SUPPORTED_ANTHROPIC_MODELS; if any UI defaults select the first entry, confirm this won’t inadvertently change defaults.
  • Optional: keep the “Tool calling supported models” section sorted by family and recency for readability.

Run this script from repo root to check for duplicates and confirm the new entry’s flags and ordering impact.

Also, please run:

  • make format_backend
  • make lint

To confirm the official model ID via public docs:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE='src/backend/base/langflow/base/models/anthropic_constants.py'

python - <<'PY'
import re, json, collections
path='src/backend/base/langflow/base/models/anthropic_constants.py'
txt=open(path, 'r', encoding='utf-8').read()

entries=[]
for m in re.finditer(r'create_model_metadata\((.*?)\)', txt, re.S):
    args=m.group(1)
    def flag(name):
        m2=re.search(rf'\b{name}\s*=\s*(True|False)', args)
        return m2.group(1)=="True" if m2 else False
    def strval(name):
        m2=re.search(rf'\b{name}\s*=\s*"([^"]+)"', args)
        return m2.group(1) if m2 else None
    entries.append({
        "provider": strval("provider"),
        "name": strval("name"),
        "tool_calling": flag("tool_calling"),
        "deprecated": flag("deprecated"),
    })

names=[e["name"] for e in entries if e["name"]]
dupes=[n for n,c in collections.Counter(names).items() if c>1]
print("Total entries:", len(entries))
print("Duplicates:", dupes)

target="claude-opus-4-1-20250805"
target_entry=next((e for e in entries if e["name"]==target), None)
print("Target entry:", json.dumps(target_entry, indent=2, sort_keys=True))

tool_supported=[e['name'] for e in entries if e.get('tool_calling', False)]
non_depr_supported=[e['name'] for e in entries if e.get('tool_calling', False) and not e.get('deprecated', False)]

print("Tool-calling supported total:", len(tool_supported))
print("Non-deprecated supported total (ANTHROPIC_MODELS):", len(non_depr_supported))
print("First 5 non-deprecated tool-calling names (order-sensitive):", non_depr_supported[:5])
PY

Length of output: 546


🌐 Web query:

What is the official model ID string for Anthropic "Claude Opus 4.1" (tool-use capable) released around 2025-08-05? Is it "claude-opus-4-1-20250805"?

💡 Result:

Yes — Anthropic’s official API model ID for Claude Opus 4.1 is "claude-opus-4-1-20250805". The alias "claude-opus-4-1" points to that snapshot. (docs.anthropic.com)

Citations:


Confirm UI Default Selection After Adding New Anthropic Model

  • Model ID “claude-opus-4-1-20250805” is correct per Anthropic’s official docs.
  • In src/backend/base/langflow/base/models/anthropic_constants.py, this entry now appears first in both the tool-calling supported list (12 entries) and the non-deprecated list (8 entries). If the UI falls back to selecting the first model by default, this will change the default from the previous model.
  • Recommended actions:
    • Explicitly set the default Anthropic model in the UI logic instead of relying on list order, or
    • Reorder/sort the TOOL_CALLING_SUPPORTED_ANTHROPIC_MODELS and ANTHROPIC_MODELS arrays by family and release date so recency is clear and defaults remain predictable.
🤖 Prompt for AI Agents
In src/backend/base/langflow/base/models/anthropic_constants.py around line 5,
the new model entry "claude-opus-4-1-20250805" has been placed first in both
TOOL_CALLING_SUPPORTED_ANTHROPIC_MODELS and ANTHROPIC_MODELS which can
unintentionally change the UI default if the frontend selects the first item;
fix this by either (A) making the UI select an explicit default Anthropic model
by key/name rather than relying on array order (update the frontend default
selection logic to read a configured default model id), or (B) reorder/sort the
TOOL_CALLING_SUPPORTED_ANTHROPIC_MODELS and ANTHROPIC_MODELS arrays by model
family and release date (or add a stable “is_default” flag to the model metadata
and ensure the arrays are sorted to put that default first) so the apparent
default remains predictable.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 27, 2025
@sonarqubecloud
Copy link

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 2, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 2, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2025

@jordanrfrazier jordanrfrazier added the lgtm This PR has been approved by a maintainer label Oct 2, 2025
@jordanrfrazier jordanrfrazier added this pull request to the merge queue Oct 2, 2025
Merged via the queue into langflow-ai:main with commit 02112f0 Oct 2, 2025
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants