Updated g4f/Provider/Blackbox.py

This commit is contained in:
kqlio67 2024-09-13 00:00:44 +03:00
parent a15578e229
commit 786a75b9f3

View File

@ -2,6 +2,8 @@ from __future__ import annotations
import re import re
import json import json
import random
import string
from aiohttp import ClientSession from aiohttp import ClientSession
from ..typing import AsyncResult, Messages, ImageType from ..typing import AsyncResult, Messages, ImageType
@ -80,16 +82,18 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin):
"imageBase64": to_data_uri(image) "imageBase64": to_data_uri(image)
} }
random_id = ''.join(random.choices(string.ascii_letters + string.digits, k=7))
data = { data = {
"messages": messages, "messages": messages,
"id": "MRtAuMi", "id": random_id,
"previewToken": None, "previewToken": None,
"userId": None, "userId": None,
"codeModelMode": True, "codeModelMode": True,
"agentMode": {}, "agentMode": {},
"trendingAgentMode": {}, "trendingAgentMode": {},
"isMicMode": False, "isMicMode": False,
"maxTokens": 1024, "maxTokens": None,
"isChromeExt": False, "isChromeExt": False,
"githubToken": None, "githubToken": None,
"clickedAnswer2": False, "clickedAnswer2": False,