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:
Lennard Geißler 2026-04-16 11:57:39 +02:00 committed by GitHub
parent ef8bb3aed4
commit 645b6a66fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 8 deletions

View file

@ -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)