|
import os |
|
from dotenv import load_dotenv |
|
|
|
load_dotenv() |
|
|
|
BASE_URL = "https://www.blackbox.ai" |
|
APP_SECRET = os.getenv("APP_SECRET") |
|
|
|
|
|
headers = { |
|
'accept': '*/*', |
|
'accept-language': 'zh-CN,zh;q=0.9', |
|
'content-type': 'application/json', |
|
'origin': 'https://www.blackbox.ai', |
|
'priority': 'u=1, i', |
|
'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', |
|
'sec-ch-ua-mobile': '?0', |
|
'sec-ch-ua-platform': '"Windows"', |
|
'sec-fetch-dest': 'empty', |
|
'sec-fetch-mode': 'cors', |
|
'sec-fetch-site': 'same-origin', |
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36', |
|
} |
|
|
|
|
|
default_model = 'blackboxai' |
|
userSelectedModel = ['gpt-4o', 'gemini-pro', 'claude-sonnet-3.5', 'blackboxai-pro'] |
|
image_models = ['Image Generation', 'repomap'] |
|
|
|
|
|
ALLOWED_MODELS = [ |
|
{"id": "gpt-4o", "name": "gpt-4o"}, |
|
{"id": "gemini-1.5-pro-latest", "name": "gemini-pro"}, |
|
{"id": "gemini-1.5-pro", "name": "gemini-pro"}, |
|
{"id": "gemini-pro", "name": "gemini-pro"}, |
|
{"id": "claude-3-5-sonnet-20240620", "name": "claude-sonnet-3.5"}, |
|
{"id": "claude-3-5-sonnet", "name": "claude-sonnet-3.5"}, |
|
{"id": "blackboxai-pro", "name": "BLACKBOXAI-PRO"}, |
|
{"id": "repomap", "name": "repomap"}, |
|
|
|
] |
|
|
|
|
|
agentMode = { |
|
'Image Generation': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "Image Generation"}, |
|
} |
|
trendingAgentMode = { |
|
"gemini-1.5-flash": {'mode': True, 'id': 'Gemini'}, |
|
"llama-3.1-8b": {'mode': True, 'id': "llama-3.1-8b"}, |
|
"llama-3.1-70b": {'mode': True, 'id': "llama-3.1-70b"}, |
|
"llama-3.1-405b": {'mode': True, 'id': "llama-3.1-405b"}, |
|
'Python Agent': {'mode': True, 'id': "Python Agent"}, |
|
'Java Agent': {'mode': True, 'id': "Java Agent"}, |
|
'JavaScript Agent': {'mode': True, 'id': "JavaScript Agent"}, |
|
'HTML Agent': {'mode': True, 'id': "HTML Agent"}, |
|
'Google Cloud Agent': {'mode': True, 'id': "Google Cloud Agent"}, |
|
'Android Developer': {'mode': True, 'id': "Android Developer"}, |
|
'Swift Developer': {'mode': True, 'id': "Swift Developer"}, |
|
'Next.js Agent': {'mode': True, 'id': "Next.js Agent"}, |
|
'MongoDB Agent': {'mode': True, 'id': "MongoDB Agent"}, |
|
'PyTorch Agent': {'mode': True, 'id': "PyTorch Agent"}, |
|
'React Agent': {'mode': True, 'id': "React Agent"}, |
|
'Xcode Agent': {'mode': True, 'id': "Xcode Agent"}, |
|
'AngularJS Agent': {'mode': True, 'id': "AngularJS Agent"}, |
|
'repomap': {'mode': True, 'id': "repomap"}, |
|
'Heroku Agent': {'mode': True, 'id': "Heroku Agent"}, |
|
'Godot Agent': {'mode': True, 'id': "Godot Agent"}, |
|
'Go Agent': {'mode': True, 'id': "Go Agent"}, |
|
'Gitlab Agent': {'mode': True, 'id': "Gitlab Agent"}, |
|
'Git Agent': {'mode': True, 'id': "Git Agent"}, |
|
'Flask Agent': {'mode': True, 'id': "Flask Agent"}, |
|
'Firebase Agent': {'mode': True, 'id': "Firebase Agent"}, |
|
'FastAPI Agent': {'mode': True, 'id': "FastAPI Agent"}, |
|
'Erlang Agent': {'mode': True, 'id': "Erlang Agent"}, |
|
'Electron Agent': {'mode': True, 'id': "Electron Agent"}, |
|
'Docker Agent': {'mode': True, 'id': "Docker Agent"}, |
|
'DigitalOcean Agent': {'mode': True, 'id': "DigitalOcean Agent"}, |
|
'Bitbucket Agent': {'mode': True, 'id': "Bitbucket Agent"}, |
|
'Azure Agent': {'mode': True, 'id': "Azure Agent"}, |
|
'Flutter Agent': {'mode': True, 'id': "Flutter Agent"}, |
|
'Youtube Agent': {'mode': True, 'id': "Youtube Agent"}, |
|
'builder Agent': {'mode': True, 'id': "builder Agent"}, |
|
} |
|
|
|
|
|
model_prefixes = {mode: f"@{value['id']}" for mode, value in trendingAgentMode.items() if mode not in ["gemini-1.5-flash", "llama-3.1-8b", "llama-3.1-70b", "llama-3.1-405b", "repomap"]} |
|
|
|
|
|
models = [default_model, *userSelectedModel, *list(agentMode.keys()), *list(trendingAgentMode.keys())] |
|
|
|
|
|
model_aliases = { |
|
"gemini-flash": "gemini-1.5-flash", |
|
"claude-3.5-sonnet": "claude-sonnet-3.5", |
|
"flux": "Image Generation", |
|
} |
|
|