From 1ed448e584092e151212b1d511fd2cbec133064b Mon Sep 17 00:00:00 2001 From: zengrr <47846202+zeng-rr@users.noreply.github.com> Date: Wed, 23 Aug 2023 19:36:30 +0800 Subject: Ails throw the contents of an error response --- g4f/Provider/Ails.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'g4f') diff --git a/g4f/Provider/Ails.py b/g4f/Provider/Ails.py index 52b3745d..806544b4 100644 --- a/g4f/Provider/Ails.py +++ b/g4f/Provider/Ails.py @@ -72,6 +72,8 @@ class Ails(BaseProvider): if b"content" in token: completion_chunk = json.loads(token.decode().replace("data: ", "")) token = completion_chunk["choices"][0]["delta"].get("content") + if "ai.ls".lower() in token.lower(): + raise Exception("Response Error: " + token) if token != None: yield token -- cgit v1.2.3