Skip to content

Commit

Permalink
fix(g4f/Provider/Blackbox.py): Improve Blackbox AI response text proc…
Browse files Browse the repository at this point in the history
…essing
  • Loading branch information
kqlio67 committed Nov 8, 2024
1 parent fece108 commit a96f9bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions g4f/Provider/Blackbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ async def create_async_generator(
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))
Expand Down

0 comments on commit a96f9bd

Please sign in to comment.