I usually need 4096 max tokens for my agents, I see the other modules have that higher limit. This is a very important setting but I don't see it configurable anywhere?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | AI chat generation.PNG | 134.92 KB | vinayakmk47 |
Issue fork ai_provider_anthropic-3502348
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:
- 3502348-max-token
changes, plain diff MR !10
- 3502348-max-tokens-too
changes, plain diff MR !8
Comments
Comment #2
vinayakmk47When the AI module is installed and Anthropic is configured as the provider, the Max Tokens setting can be adjusted directly in the admin interface. Navigate to the following URL to access this setting:
URL: admin/config/ai/explorers/chat_generator
On this page, under the Provider Configuration section (as shown in the screenshot), you will find the Max Tokens input field. This field allows you to specify the desired maximum token limit for chat completions. For example, you can input 4096 to accommodate your requirements.
This ensures flexibility and control over the token limit for your specific use case without requiring any code-level changes.
Comment #3
vinayakmk47Comment #4
abhineshAdded the possibility to alter the max output tokens in the forked repo.
Comment #6
abhineshComment #10
pavnish commentedHi Marcus,
Could you please review the MR? We have provided the configuration option to set the token limit and ensured it is used from this configuration.
Please let me know if you need any changes.
Thanks,
Pavnish
Comment #11
pavnish commentedComment #12
majorrobot commentedI've tested the fork, and it worked as intended (and helped us get past a painful token bottleneck). It would be great to have this feature available. Thanks for your work on this!
(I suspect it may need a rebase, tho.)
Comment #13
robloachI can review.
Comment #14
robloachMay need the Config Schema to be updated to include max_tokens.
Comment #15
robloachComment #16
robloachAdded the config schema as nullable. Tested export, and it's working. Thanks!