diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-10-22 18:08:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 18:08:03 +0200 |
commit | d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56 (patch) | |
tree | 9cc4e7401fdf42efdf6b42670acd3c2a72214ebf /g4f/Provider/FreeGpt.py | |
parent | ~ | Merge pull request #1112 from lategege/main (diff) | |
parent | Fix ChatgptAi Provider (diff) | |
download | gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar.gz gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar.bz2 gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar.lz gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar.xz gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.tar.zst gpt4free-d1eaa46360b7fe30d6f9c60f5a4af6246c24dc56.zip |
Diffstat (limited to 'g4f/Provider/FreeGpt.py')
-rw-r--r-- | g4f/Provider/FreeGpt.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/Provider/FreeGpt.py b/g4f/Provider/FreeGpt.py index 6638b67f..a6d31644 100644 --- a/g4f/Provider/FreeGpt.py +++ b/g4f/Provider/FreeGpt.py @@ -41,7 +41,10 @@ class FreeGpt(AsyncGeneratorProvider): async with session.post(f"{url}/api/generate", json=data) as response: response.raise_for_status() async for chunk in response.iter_content(): - yield chunk.decode() + chunk = chunk.decode() + if chunk == "当前地区当日额度已消耗完": + raise RuntimeError("Rate limit reached") + yield chunk @classmethod @property |