Ails throw the contents of an error response

This commit is contained in:
zengrr 2023-08-23 19:36:30 +08:00
parent 6a4463889e
commit 1ed448e584

View File

@ -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