mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
refactor: move contextWindowSize to ContentGeneratorConfig
- Add contextWindowSize field to ContentGeneratorConfig interface - Update tokenLimit function to accept contentGeneratorConfig parameter - Implement priority logic: user config > auto-detection - Update chatCompressionService to use new API via getContentGeneratorConfig() - Add contextWindowSize to MODEL_GENERATION_CONFIG_FIELDS for config resolution - Add contextWindowSize to CLI settings schema (model.generationConfig) - Update UI components (Footer, ContextUsageDisplay) to use new config API - Fix test mocks to include getContentGeneratorConfig method This refactor avoids modifying 71+ test files by moving the config to the generator level instead of the Config class level. Modified files: - packages/core/src/core/contentGenerator.ts - packages/core/src/core/tokenLimits.ts - packages/core/src/services/chatCompressionService.ts - packages/core/src/services/chatCompressionService.test.ts - packages/core/src/models/constants.ts - packages/cli/src/config/settingsSchema.ts - packages/cli/src/ui/components/ContextUsageDisplay.tsx - packages/cli/src/ui/components/Footer.tsx
This commit is contained in:
parent
52d6d1ff13
commit
a684f07ff4
8 changed files with 42 additions and 3 deletions
|
|
@ -690,6 +690,18 @@ const SETTINGS_SCHEMA = {
|
|||
{ value: 'openapi_30', label: 'OpenAPI 3.0 Strict' },
|
||||
],
|
||||
},
|
||||
contextWindowSize: {
|
||||
type: 'number',
|
||||
label: 'Context Window Size',
|
||||
category: 'Generation Configuration',
|
||||
requiresRestart: false,
|
||||
default: -1,
|
||||
description:
|
||||
'Override the automatic context window size detection. Set to -1 to use automatic detection based on the model. Set to a positive number to use a custom context window size.',
|
||||
parentKey: 'generationConfig',
|
||||
childKey: 'contextWindowSize',
|
||||
showInDialog: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue