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

Class _FakeTool

tests/lib/tools/test_session_runner.py:253–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253class _FakeTool:
254 def __init__(
255 self,
256 name: str,
257 fn: Callable[[dict[str, Any]], Awaitable[Any]],
258 *,
259 close: Callable[[], Any] | None = None,
260 ) -> None:
261 self.name = name
262 self._fn = fn
263 if close is not None:
264 self.close = close
265
266 def call(self, input: dict[str, Any]) -> Any:
267 return self._fn(input)
268
269
270class _SyncTool(BetaBuiltinFunctionTool):

Calls

no outgoing calls