| 251 | |
| 252 | |
| 253 | class _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 | |
| 270 | class _SyncTool(BetaBuiltinFunctionTool): |
no outgoing calls