Add back crutch of incorrect responses to ChatBase

pull/1258/head
razrab 8 months ago
parent 2e46f1c074
commit 1906b5fd06

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

Loading…
Cancel
Save