MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _FakeTool

Class _FakeTool

tests/lib/tools/test_session_runner.py:230–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229
230class _FakeTool:
231 def __init__(
232 self,
233 name: str,
234 fn: Callable[[dict[str, Any]], Awaitable[Any]],
235 *,
236 close: Callable[[], Any] | None = None,
237 ) -> None:
238 self.name = name
239 self._fn = fn
240 if close is not None:
241 self.close = close
242
243 def call(self, input: dict[str, Any]) -> Any:
244 return self._fn(input)
245
246
247class _FakeClient:

Calls

no outgoing calls