Call the method, handling both sync and async functions.
(method_callable, args)
| 166 | |
| 167 | |
| 168 | def call_method(method_callable, args): |
| 169 | """Call the method, handling both sync and async functions.""" |
| 170 | if inspect.iscoroutinefunction(method_callable): |
| 171 | return asyncio.run(method_callable(*args)) |
| 172 | else: |
| 173 | return method_callable(*args) |
| 174 | |
| 175 | |
| 176 | def _truncate_body(text, max_length=4096): |
no test coverage detected
searching dependent graphs…