Problem/Motivation

Claude Haiku 4.5 models do not appear when filtering by ChatJsonOutput capability. The regex in getConfiguredModels() excludes Haiku:

'/claude-3\.[57]|claude-3-[57]|claude-4|claude-(opus|sonnet)-4/i'

This matches claude-opus-4 and claude-sonnet-4 but not claude-haiku-4.

Steps to reproduce

  1. Call getConfiguredModels('chat', [AiModelCapability::ChatJsonOutput])
  2. Claude Haiku 4.5 models are not returned

Proposed resolution

Add haiku to the regex pattern:

'/claude-3\.[57]|claude-3-[57]|claude-4|claude-(opus|sonnet|haiku)-4/i'

Remaining tasks

  • Update regex in getConfiguredModels()

User interface changes

Haiku 4.5 models will appear in model selection when JSON output capability is required.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

camoa created an issue. See original summary.

camoa’s picture

Status: Active » Needs review

Added haiku to the regex pattern on line 49 of AnthropicProvider.php:

-claude-(opus|sonnet)-4
+claude-(opus|sonnet|haiku)-4

Haiku 4.5 supports JSON output via prompt engineering and tool/function calling, which aligns with the current ChatJsonOutput capability definition. The Anthropic /v1/models API doesn't provide capability
metadata, so the regex-based approach is the only option for now.

MR ready for review.