Abstract LLM backend used by the documentation generator.
| 33 | |
| 34 | |
| 35 | class LLMBackend(abc.ABC): |
| 36 | """Abstract LLM backend used by the documentation generator.""" |
| 37 | |
| 38 | @abc.abstractmethod |
| 39 | def complete( |
| 40 | self, |
| 41 | prompt: str, |
| 42 | *, |
| 43 | model: str | None = None, |
| 44 | ) -> str: |
| 45 | """Single-shot text completion.""" |
| 46 | |
| 47 | @abc.abstractmethod |
| 48 | async def run_module_agent( |
| 49 | self, |
| 50 | module_name: str, |
| 51 | components: Dict[str, "Node"], |
| 52 | core_component_ids: List[str], |
| 53 | module_path: List[str], |
| 54 | working_dir: str, |
| 55 | ) -> Dict[str, Any]: |
| 56 | """Run the per-module agent loop. Returns the updated module_tree dict.""" |
| 57 | |
| 58 | |
| 59 | def get_backend(config) -> "LLMBackend": |
| 60 | """Return the backend instance matching ``config.provider``.""" |
nothing calls this directly
no outgoing calls
no test coverage detected