Module trait.
What is a module?
- Purpose: Encapsulate a multi-step workflow (e.g., analysis then answer) as a single callable unit.
- Rust shape: Any type implementing
Modulewith anasync fn forward(&self, inputs: Example). - Composition: Typically holds one or more
Predictfields and sequences their calls.
Minimal example
Design notes
- Traits and async:
Moduleis a trait with an async method; implement it where your composition lives. - State: Keep structured state as fields (other predictors, config, toggles). Prefer builders for complex modules.
- Testability: You can inject a
DummyLMviaforward_with_configin tests to avoid network calls.
