Using the newer opus models is generating this error:

The following error occurred while processing your request:
Error invoking model response: `temperature` and `top_p` cannot both be specified for this model. Please use only one.
Of the following exception type:
Drupal\ai\Exception\AiRequestErrorException 
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

paulsheldrake created an issue. See original summary.

kelly.m.jacobs’s picture

Assigned: Unassigned » kelly.m.jacobs
kelly.m.jacobs’s picture

I've been unable to reproduce this error. I've tried every combination with the following variations in the AI Assistant:
Opus 4.6, 4.5, and 4.1
Temperature set to 0 or 1
Top K set to 0 or 1

kelly.m.jacobs’s picture

Assigned: kelly.m.jacobs » Unassigned
Status: Active » Needs review
marcus_johansson’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Upping this to Major. Can replicate it in AI API Explorer, where all configuration values are always sent.

This affects haiku as well, so Claude Haiku 4.5.

arianraeesi’s picture

lbesenyei’s picture

Assigned: Unassigned » lbesenyei
dan2k3k4’s picture

This also occurs for other providers that use Claude such as ai_provider_amazeeio and ai_provider_litellm.

It is happening on ai_api_explorer - if "top_p" and/or "temperature" are not set, they still get sent as null values.

lbesenyei’s picture

Assigned: lbesenyei » Unassigned
Status: Needs work » Needs review

I have updated regex to inlude all claude models.

Raised an issue in AI module (#3580249) to prevent other providers, using affected models.

I have tested with claude and amazee providers.

marcus_johansson’s picture

Assigned: Unassigned » marcus_johansson
marcus_johansson’s picture

Assigned: marcus_johansson » Unassigned
Status: Needs review » Fixed

Code looks good and it is working with all model now. Merging. Thanks everyone!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

marcus_johansson’s picture

This is also released in 1.2.2 now.

arianraeesi’s picture

Issue tags: -AI Product Development

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.