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

Class _FakeTool

tests/lib/tools/test_session_runner.py:238–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls