fix: fallback custom model maxOutputTokens to OUTPUT_TOKEN_MAX#22291
fix: fallback custom model maxOutputTokens to OUTPUT_TOKEN_MAX#22291MertSoylu wants to merge 1 commit into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Found a related PR: PR #22016 - "fix: handle invalid maxOutputTokens value (0 or undefined)" This PR appears to be closely related as it also addresses the |
e803e9d to
205fc06
Compare
Custom provider models without a limit field were falling back to 0, causing 'maxOutputTokens must be >= 1' validation error. Now falls back to ProviderTransform.OUTPUT_TOKEN_MAX (32000). Fixes anomalyco#22253
205fc06 to
95332c1
Compare
Issue for this PR Closes #22253 ### Type of change - [x] Bug fix ### What does this PR do? Fixes custom provider models failing with "maxOutputTokens must be >= 1" when limit field is not defined. The issue was in
provider.tscustom model parsing where models without alimitfield fell back to 0 instead ofOUTPUT_TOKEN_MAX(32000). Changed the fallback to useProviderTransform.OUTPUT_TOKEN_MAX, consistent with built-in models. This is a different approach from PR #22016 which fixed the same issue in thetransform.tsmaxOutputTokens()function. This fix addresses it at the provider config parsing level. ### How did you verify my code works? - Analyzed the code to understand the fallback logic - Confirmed built-in models useOUTPUT_TOKEN_MAXas fallback - Changed custom model parsing to use the same fallback ### Checklist - [x] I have tested my changes locally - [x] I have not included unrelated changes in this PR