mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
fix: replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction (#819)
asyncio.iscoroutinefunction is deprecated since Python 3.14 and slated for removal in 3.16. The inspect equivalent has an identical signature and return semantics. Replaces 8 call sites across 3 modules to silence DeprecationWarnings reported in #818.
This commit is contained in:
parent
ef8bb3aed4
commit
645b6a66fd
3 changed files with 11 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
import json
|
||||
import asyncio
|
||||
import inspect
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Any
|
||||
|
||||
|
|
@ -80,7 +81,7 @@ class PromptClient(RequestResponse):
|
|||
|
||||
if resp.text is not None:
|
||||
if chunk_callback:
|
||||
if asyncio.iscoroutinefunction(chunk_callback):
|
||||
if inspect.iscoroutinefunction(chunk_callback):
|
||||
await chunk_callback(resp.text, end_stream)
|
||||
else:
|
||||
chunk_callback(resp.text, end_stream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue