Problem/Motivation
Things have been hunky dory when using Gemini as a provider, but when testing with Anthropic/Claude, we started receiving truncated responses for some calls.
It turns out that the max_tokens for Anthropic is somehow set to 2048 tokens. So, some responses are greater than 2048 and get truncated. See https://www.drupal.org/project/ai_migration/issues/3545198.
Add a way to configure the provider/model in the migration yml. This should include max_tokens, as well as other settings in provider modules web/modules/contrib/ai_provider_anthropic/definitions/api_defaults.yml.
Issue fork ai_migration-3546717
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
Comment #2
majorrobot commentedComment #3
majorrobot commentedComment #6
majorrobot commentedComment #7
majorrobot commentedThis is ready for review.
QA Steps
Note: you will need an Anthropic key and a Gemini key to test this branch.
Comment #8
dmundraAnthropic migration worked but when I switched to Gemini I got an error,
I change the migration as per the qa steps. Maybe I missed something?
Comment #9
majorrobot commentedThanks for finding that, @dmundra. That didn't occur in my testing at first, but now I'm seeing it.
It looks like we need to increase the
maxOutputTokensvalue when using Gemini. It uses reasoning and thus “thinking tokens” which apparently count against your output. I increased themaxOutputTokensby a factor of 4 (8096->32384), and it ran without issue.Updated the QA steps.
Comment #10
dmundraThank you @majorrobot for finding that. It worked for me after that change.
Comment #12
dmundraComment #14
dmundra