Update (g4f/Provider/Blackbox.py)

This commit is contained in:
kqlio67 2024-10-17 15:47:36 +03:00
parent 4cd1ed1a71
commit d9892cebfd

View File

@ -181,7 +181,7 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin):
model (str): Model to use for generating responses. model (str): Model to use for generating responses.
messages (Messages): Message history. messages (Messages): Message history.
proxy (Optional[str]): Proxy URL, if needed. proxy (Optional[str]): Proxy URL, if needed.
web_search_mode (bool): Enables or disables web search mode. websearch (bool): Enables or disables web search mode.
**kwargs: Additional keyword arguments. **kwargs: Additional keyword arguments.
Yields: Yields:
@ -298,7 +298,7 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin):
else: else:
yield cleaned_response yield cleaned_response
else: else:
if web_search_mode: if websearch:
match = re.search(r'\$~~~\$(.*?)\$~~~\$', cleaned_response, re.DOTALL) match = re.search(r'\$~~~\$(.*?)\$~~~\$', cleaned_response, re.DOTALL)
if match: if match:
source_part = match.group(1).strip() source_part = match.group(1).strip()