feat: add max_tokens configuration for AI translation services#11
Merged
zccrs merged 2 commits intozccrs:masterfrom Aug 11, 2025
Merged
feat: add max_tokens configuration for AI translation services#11zccrs merged 2 commits intozccrs:masterfrom
zccrs merged 2 commits intozccrs:masterfrom
Conversation
1. Added max_tokens field to all translator structs (OpenAI, Claude, Gemini, Grok, Qwen) 2. Integrated max_tokens configuration from config file with default fallback (2048) 3. Added max_tokens parameter to API requests for all translation services 4. Replaced hardcoded max_tokens value in Qwen implementation with configurable value This change allows better control over token usage and response length across all AI translation services. The configurable max_tokens parameter enables: - Cost optimization by limiting token consumption - Better response time management - Consistent behavior across different translation models - More flexible configuration based on use case requirements
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds configurable max_tokens support across all AI translation services to enable better control over token usage and response management. The implementation removes hardcoded token limits and provides consistent configuration across different AI providers.
- Adds
max_tokensfield to all translator structs (OpenAI, Claude, Gemini, Grok, Qwen) - Integrates configuration loading with 2048 token default fallback
- Replaces hardcoded values with configurable parameters in API requests
zccrs
approved these changes
Aug 11, 2025
Co-authored-by: Copilot <[email protected]>
zccrs
approved these changes
Aug 11, 2025
Owner
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change allows better control over token usage and response length across all AI translation services. The configurable max_tokens parameter enables: