From 348670fe35369298af8e289af9d523beecfed4c3 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Tue, 26 Sep 2023 00:52:29 +0200 Subject: "create_async" support for BaseProvider, by using ThreadPoolExecutor Default Model for Vercel --- g4f/Provider/Aivvm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/Aivvm.py') diff --git a/g4f/Provider/Aivvm.py b/g4f/Provider/Aivvm.py index c38c4a74..7a3d57bd 100644 --- a/g4f/Provider/Aivvm.py +++ b/g4f/Provider/Aivvm.py @@ -60,9 +60,10 @@ class Aivvm(BaseProvider): response = requests.post( "https://chat.aivvm.com/api/chat", headers=headers, json=json_data, stream=True) + response.raise_for_status() - for line in response.iter_content(chunk_size=1048): - yield line.decode('utf-8') + for chunk in response.iter_content(chunk_size=None): + yield chunk.decode('utf-8') @classmethod @property -- cgit v1.2.3