From d4c8f3e8d595c50890aafd3911a1da54a8080287 Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Sun, 19 Nov 2023 23:14:30 +0000 Subject: ~ | trying to improve compability with python versions < 3.8 --- g4f/Provider/AItianhu.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'g4f/Provider/AItianhu.py') diff --git a/g4f/Provider/AItianhu.py b/g4f/Provider/AItianhu.py index 0a31e40b..fcf9a4fb 100644 --- a/g4f/Provider/AItianhu.py +++ b/g4f/Provider/AItianhu.py @@ -71,12 +71,11 @@ class AItianhu(AsyncGeneratorProvider): if "detail" not in line: raise RuntimeError(f"Response: {line}") - if content := line["detail"]["choices"][0]["delta"].get( - "content" - ): + + content = line["detail"]["choices"][0]["delta"].get("content") + if content: yield content - @classmethod @property def params(cls): -- cgit v1.2.3