-
Notifications
You must be signed in to change notification settings - Fork 6
Closed as not planned
Description
Summary
Start the refactoring of synthesizer architecture to use composition pattern with BaseSynthesizer as infrastructure base and TemplateSynthesizer as orchestration layer.
Problem / Opportunity
Current synthesizer stack has duplicated code across multiple synthesizer classes (PromptSynthesizer, ConfigSynthesizer, etc.) and lacks clear separation of concerns. Need cleaner architecture with reusable components.
Users & Use Cases
- SDK developers maintaining synthesizer code
- Users creating custom synthesizers
- Use case: Cleaner, more maintainable synthesizer architecture
Proposal
Replace current synthesizer hierarchy with:
BaseSynthesizer
- Core base class (not used directly)
- Provides model management, progress tracking, common utilities
- Inherited by all synthesizers
TemplateSynthesizer
- Orchestration layer using composition pattern
- Delegates to specialized components:
- TemplateLoader (template management)
- TemplateRenderer (template rendering)
- LLMExecutor (or similar component, or delegate it to utility functions: LLM execution with retry/batching
- Single synthesizer for all template-based synthesis
Acceptance Criteria
- BaseSynthesizer provides core infrastructure without business logic
- TemplateSynthesizer orchestrates synthesis pipeline via components
- TemplateLoader manages template discovery and validation
- TemplateRenderer handles template rendering
- LLMExecutor manages LLM calls with retry/batching
- ResponseParser handles response parsing
- All components are testable in isolation
- Existing synthesizer functionality preserved