summaryrefslogtreecommitdiffstats
path: root/g4f/Provider
diff options
context:
space:
mode:
authorrazrab <razrab@PimoLin>2023-11-16 10:05:53 +0100
committerrazrab <razrab@PimoLin>2023-11-16 10:05:53 +0100
commit1906b5fd06917f745c0a2f68c7f2897954be2bc3 (patch)
tree2c702b2f1fb81aad670a4d7560f94d637509053e /g4f/Provider
parentMerge pull request #1250 from kacperkwapisz/patch-1 (diff)
downloadgpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar.gz
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar.bz2
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar.lz
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar.xz
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.tar.zst
gpt4free-1906b5fd06917f745c0a2f68c7f2897954be2bc3.zip
Diffstat (limited to 'g4f/Provider')
-rw-r--r--g4f/Provider/ChatBase.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/g4f/Provider/ChatBase.py b/g4f/Provider/ChatBase.py
index 9f11e1ac..ccc20244 100644
--- a/g4f/Provider/ChatBase.py
+++ b/g4f/Provider/ChatBase.py
@@ -12,6 +12,8 @@ class ChatBase(AsyncGeneratorProvider):
supports_message_history = True
working = True
jailbreak = True
+ list_incorrect_responses = ["support@chatbase",
+ "about Chatbase"]
@classmethod
async def create_async_generator(
@@ -53,6 +55,9 @@ class ChatBase(AsyncGeneratorProvider):
response_data = ""
async for stream in response.content.iter_any():
response_data += stream.decode()
+ for incorrect_response in cls.list_incorrect_responses:
+ if incorrect_response in response_data:
+ raise RuntimeError("Incorrect response")
yield stream.decode()
@classmethod