From c01a8539b0fd9449436904c26d6e98a28ebdf73a Mon Sep 17 00:00:00 2001 From: zengrr <47846202+zeng-rr@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:07:22 +0800 Subject: fix Equing response error with no stream --- g4f/Provider/Equing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/g4f/Provider/Equing.py b/g4f/Provider/Equing.py index bcf6cff9..90c865d9 100644 --- a/g4f/Provider/Equing.py +++ b/g4f/Provider/Equing.py @@ -53,6 +53,9 @@ class Equing(ABC): response = requests.post('https://next.eqing.tech/api/openai/v1/chat/completions', headers=headers, json=json_data, stream=stream) + if not stream: + yield response.json()["choices"][0]["message"]["content"] + return for line in response.iter_content(chunk_size=1024): if line: -- cgit v1.2.3