From a96f9bdbdfb076e27e1ea36bfc83afef24e0cedc Mon Sep 17 00:00:00 2001 From: kqlio67 Date: Fri, 8 Nov 2024 22:31:53 +0200 Subject: fix(g4f/Provider/Blackbox.py): Improve Blackbox AI response text processing --- g4f/Provider/Blackbox.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'g4f') diff --git a/g4f/Provider/Blackbox.py b/g4f/Provider/Blackbox.py index 4811c45e..998ec593 100644 --- a/g4f/Provider/Blackbox.py +++ b/g4f/Provider/Blackbox.py @@ -189,6 +189,8 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin): yield image_response return + response_text = re.sub(r'Generated by BLACKBOX.AI, try unlimited chat https://www.blackbox.ai', '', response_text, flags=re.DOTALL) + json_match = re.search(r'\$~~~\$(.*?)\$~~~\$', response_text, re.DOTALL) if json_match: search_results = json.loads(json_match.group(1)) -- cgit v1.2.3