Problem
The PluralizationConfig type currently requires a model string even when enabled: false. This forces users to provide API keys and model configuration for a feature they're not using.
Current Behavior
model is always required in PluralizationConfig
PluralizationService constructor always initializes the AI model
- API keys are validated even when pluralization is disabled
Expected Behavior
model should only be required when enabled: true
- Model should be lazy-initialized only when needed
- No unnecessary API calls when pluralization is disabled
Proposed Solution
- Make
model optional in PluralizationConfig: model?: string
- Add runtime check: throw error if
enabled: true but no model
- Move model initialization from constructor to
generateBatch() method
Benefits
- Better DX: Users don't need to configure unused features
- Performance: No unnecessary model initialization
- Resource efficiency: No API key validation when not needed
- Cleaner config: Only required fields when disabled
Problem
The
PluralizationConfigtype currently requires amodelstring even whenenabled: false. This forces users to provide API keys and model configuration for a feature they're not using.Current Behavior
modelis always required inPluralizationConfigPluralizationServiceconstructor always initializes the AI modelExpected Behavior
modelshould only be required whenenabled: trueProposed Solution
modeloptional inPluralizationConfig:model?: stringenabled: truebut no modelgenerateBatch()methodBenefits