MCPcopy Create free account
hub / github.com/IBM/AssetOpsBench / _CapturingLLM

Class _CapturingLLM

src/agent/tests/test_runner.py:87–96  ·  view source on GitHub ↗

Records every generate() prompt and returns a canned response.

Source from the content-addressed store, hash-verified

85
86
87class _CapturingLLM:
88 """Records every generate() prompt and returns a canned response."""
89
90 def __init__(self, response: str = "{}") -> None:
91 self.prompts: list[str] = []
92 self._response = response
93
94 def generate(self, prompt: str, **_kw) -> str:
95 self.prompts.append(prompt)
96 return self._response
97
98
99# ── orchestrator tests ────────────────────────────────────────────────────────

Calls

no outgoing calls