Replace asyncio.iscoroutine with inspect.isawaitable for better detection
This commit is contained in:
parent
72f68c2a61
commit
7d394fb0a4
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import traceback
|
||||
import asyncio
|
||||
import configparser
|
||||
import inspect
|
||||
import os
|
||||
import time
|
||||
import warnings
|
||||
|
|
@ -1793,8 +1794,8 @@ class LightRAG:
|
|||
self.chunk_token_size,
|
||||
)
|
||||
|
||||
# If result is a coroutine, await to get actual result
|
||||
if asyncio.iscoroutine(chunking_result):
|
||||
# If result is awaitable, await to get actual result
|
||||
if inspect.isawaitable(chunking_result):
|
||||
chunking_result = await chunking_result
|
||||
|
||||
# Validate return type
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue