summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorkqlio67 <kqlio67@users.noreply.github.com>2024-09-12 23:00:44 +0200
committerkqlio67 <kqlio67@users.noreply.github.com>2024-09-12 23:00:44 +0200
commit786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14 (patch)
tree061f3571ad4d439382075f3319ccdffa852c8c8e /g4f
parentrefactor(g4f/Provider/Blackbox.py): streamline model handling and improve image generation (diff)
downloadgpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar.gz
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar.bz2
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar.lz
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar.xz
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.tar.zst
gpt4free-786a75b9f3fc0a4a64415bcb97eb7c31d98b2f14.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/Provider/Blackbox.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/g4f/Provider/Blackbox.py b/g4f/Provider/Blackbox.py
index 014ffc55..d3d68ade 100644
--- a/g4f/Provider/Blackbox.py
+++ b/g4f/Provider/Blackbox.py
@@ -2,6 +2,8 @@ from __future__ import annotations
import re
import json
+import random
+import string
from aiohttp import ClientSession
from ..typing import AsyncResult, Messages, ImageType
@@ -80,16 +82,18 @@ class Blackbox(AsyncGeneratorProvider, ProviderModelMixin):
"imageBase64": to_data_uri(image)
}
+ random_id = ''.join(random.choices(string.ascii_letters + string.digits, k=7))
+
data = {
"messages": messages,
- "id": "MRtAuMi",
+ "id": random_id,
"previewToken": None,
"userId": None,
"codeModelMode": True,
"agentMode": {},
"trendingAgentMode": {},
"isMicMode": False,
- "maxTokens": 1024,
+ "maxTokens": None,
"isChromeExt": False,
"githubToken": None,
"clickedAnswer2": False,