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/GptGo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/GptGo.py') diff --git a/g4f/Provider/GptGo.py b/g4f/Provider/GptGo.py index 6d477da0..ac3f7fe8 100644 --- a/g4f/Provider/GptGo.py +++ b/g4f/Provider/GptGo.py @@ -62,7 +62,9 @@ class GptGo(AsyncGeneratorProvider): line = json.loads(line[len(start):-1]) if line["choices"][0]["finish_reason"] == "stop": break - if content := line["choices"][0]["delta"].get("content"): + + content = line["choices"][0]["delta"].get("content"): + if content: yield content -- cgit v1.2.3