| 232 | |
| 233 | |
| 234 | class _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 | |
| 251 | class _SyncTool(BetaBuiltinFunctionTool): |
no outgoing calls