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

Class _FakeTool

tests/lib/tools/test_session_runner.py:234–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls