MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / LLMBackend

Class LLMBackend

codewiki/src/be/backend.py:35–57  ·  view source on GitHub ↗

Abstract LLM backend used by the documentation generator.

Source from the content-addressed store, hash-verified

33
34
35class 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
59def get_backend(config) -> "LLMBackend":
60 """Return the backend instance matching ``config.provider``."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected