test24 / api /config.py
Niansuh's picture
Upload 14 files
381d345 verified
import os
from dotenv import load_dotenv
load_dotenv()
BASE_URL = "https://www.blackbox.ai"
common_headers = {
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'content-type': 'application/json',
'origin': BASE_URL,
'priority': 'u=1, i',
'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
'sec-ch-ua-arch': '"x86"',
'sec-ch-ua-bitness': '"64"',
'sec-ch-ua-full-version': '"131.0.6778.86"',
'sec-ch-ua-full-version-list': '"Google Chrome";v="131.0.6778.86", "Chromium";v="131.0.6778.86", "Not_A Brand";v="24.0.0.0"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-model': '""',
'sec-ch-ua-platform': '"Windows"',
'sec-ch-ua-platform-version': '"19.0.0"',
'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/131.0.0.0 Safari/537.36',
}
# Header Configurations for Specific API Calls
def get_headers_api_chat(referer_url):
return {**common_headers, 'Content-Type': 'application/json', 'Referer': referer_url}
def get_headers_chat(chat_url, next_action, next_router_state_tree):
return {
**common_headers,
'Accept': 'text/x-component',
'Content-Type': 'text/plain;charset=UTF-8',
'Referer': chat_url,
'next-action': next_action,
'next-router-state-tree': next_router_state_tree,
'next-url': '/',
}
APP_SECRET = os.getenv("APP_SECRET")
ALLOWED_MODELS = [
{"id": "blackboxai", "name": "blackboxai"},
{"id": "blackboxai-pro", "name": "blackboxai-pro"},
{"id": "flux", "name": "flux"},
{"id": "llama-3.1-8b", "name": "llama-3.1-8b"},
{"id": "llama-3.1-70b", "name": "llama-3.1-70b"},
{"id": "llama-3.1-405b", "name": "llama-3.1-405"},
{"id": "gpt-4o", "name": "gpt-4o"},
{"id": "gpt-4o-2024-05-13", "name": "gpt-4o"},
{"id": "gemini-pro", "name": "gemini-pro"},
{"id": "gemini-1.5-flash", "name": "gemini-1.5-flash"},
{"id": "claude-sonnet-3.5", "name": "claude-sonnet-3.5"},
{"id": "PythonAgent", "name": "python"},
{"id": "JavaAgent", "name": "java"},
{"id": "JavaScriptAgent", "name": "javascript"},
{"id": "HTMLAgent", "name": "html"},
{"id": "GoogleCloudAgent", "name": "googlecloud"},
{"id": "AndroidDeveloper", "name": "androiddeveloper"},
{"id": "SwiftDeveloper", "name": "swiftdeveloper"},
{"id": "Next.jsAgent", "name": "next.js"},
{"id": "MongoDBAgent", "name": "mongodb"},
{"id": "PyTorchAgent", "name": "pytorch"},
{"id": "ReactAgent", "name": "react"},
{"id": "XcodeAgent", "name": "xcode"},
{"id": "AngularJSAgent", "name": "angularjs"},
{"id": "HerokuAgent", "name": "heroku"},
{"id": "GodotAgent", "name": "godot"},
{"id": "GoAgent", "name": "go"},
{"id": "GitlabAgent", "name": "gitlab"},
{"id": "GitAgent", "name": "git"},
{"id": "RepoMap", "name": "repomap"},
{"id": "gemini-1.5-pro-latest", "name": "gemini-pro"},
{"id": "gemini-1.5-pro", "name": "gemini-1.5-pro"},
{"id": "claude-3-5-sonnet-20240620", "name": "claude-sonnet-3.5"},
{"id": "claude-3-5-sonnet", "name": "claude-sonnet-3.5"},
{"id": "Niansuh", "name": "niansuh"},
{"id": "o1-preview", "name": "o1-preview"},
{"id": "claude-3-5-sonnet-20241022", "name": "claude-3-5-sonnet-20241022"},
{"id": "claude-3-5-sonnet-x", "name": "claude-3-5-sonnet-x"},
{"id": "gpt-3.5-turbo", "name": "gpt-3.5-turbo"},
{"id": "gpt-3.5-turbo-202201", "name": "gpt-3.5-turbo-202201"},
# Added New Agents
{"id": "FlaskAgent", "name": "flask"},
{"id": "FirebaseAgent", "name": "firebase"},
{"id": "FastAPIAgent", "name": "fastapi"},
{"id": "ErlangAgent", "name": "erlang"},
{"id": "ElectronAgent", "name": "electron"},
{"id": "DockerAgent", "name": "docker"},
{"id": "DigitalOceanAgent", "name": "digitalocean"},
{"id": "BitbucketAgent", "name": "bitbucket"},
{"id": "AzureAgent", "name": "azure"},
{"id": "FlutterAgent", "name": "flutter"},
{"id": "YoutubeAgent", "name": "youtube"},
{"id": "builderAgent", "name": "builder"},
]
MODEL_MAPPING = {
"blackboxai": "blackboxai",
"blackboxai-pro": "blackboxai-pro",
"flux": "flux",
"ImageGeneration": "flux",
"llama-3.1-8b": "llama-3.1-8b",
"llama-3.1-70b": "llama-3.1-70b",
"llama-3.1-405b": "llama-3.1-405",
"gpt-4o": "gpt-4o",
"gpt-4o-2024-05-13": "gpt-4o",
"gemini-pro": "gemini-pro",
"gemini-1.5-flash": "gemini-1.5-flash",
"claude-sonnet-3.5": "claude-sonnet-3.5",
"PythonAgent": "python",
"JavaAgent": "java",
"JavaScriptAgent": "javascript",
"HTMLAgent": "html",
"GoogleCloudAgent": "googlecloud",
"AndroidDeveloper": "androiddeveloper",
"SwiftDeveloper": "swiftdeveloper",
"Next.jsAgent": "next.js",
"MongoDBAgent": "mongodb",
"PyTorchAgent": "pytorch",
"ReactAgent": "react",
"XcodeAgent": "xcode",
"AngularJSAgent": "angularjs",
"HerokuAgent": "heroku",
"GodotAgent": "godot",
"GoAgent": "go",
"GitlabAgent": "gitlab",
"GitAgent": "git",
"RepoMap": "repomap",
# Additional mappings
"gemini-flash": "gemini-1.5-flash",
"claude-3.5-sonnet": "claude-sonnet-3.5",
"gemini-1.5-pro-latest": "gemini-pro",
"gemini-1.5-pro": "gemini-1.5-pro",
"claude-3-5-sonnet-20240620": "claude-sonnet-3.5",
"claude-3-5-sonnet": "claude-sonnet-3.5",
"Niansuh": "niansuh",
"o1-preview": "o1-preview",
"claude-3-5-sonnet-20241022": "claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-x": "claude-3-5-sonnet-x",
"gpt-3.5-turbo": "gpt-3.5-turbo",
"gpt-3.5-turbo-202201": "gpt-3.5-turbo-202201",
# Added New Agents
"FlaskAgent": "flask",
"FirebaseAgent": "firebase",
"FastAPIAgent": "fastapi",
"ErlangAgent": "erlang",
"ElectronAgent": "electron",
"DockerAgent": "docker",
"DigitalOceanAgent": "digitalocean",
"BitbucketAgent": "bitbucket",
"AzureAgent": "azure",
"FlutterAgent": "flutter",
"YoutubeAgent": "youtube",
"builderAgent": "builder",
}
# Agent modes
AGENT_MODE = {
'flux': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "flux"},
'Niansuh': {'mode': True, 'id': "NiansuhAIk1HgESy", 'name': "niansuh"},
'o1-preview': {'mode': True, 'id': "o1Dst8La8", 'name': "o1-preview"},
'claude-3-5-sonnet-20241022': {'mode': True, 'id': "Claude-Sonnet-3.5zO2HZSF", 'name': "claude-3-5-sonnet-20241022"},
'claude-3-5-sonnet-x': {'mode': True, 'id': "Claude-Sonnet-3.52022JE0UdQ3", 'name': "claude-3-5-sonnet-x"},
'gpt-3.5-turbo': {'mode': True, 'id': "GPT-3.5-TurboYxtGz0H", 'name': "gpt-3.5-turbo"},
'gpt-3.5-turbo-202201': {'mode': True, 'id': "GPT-3.5-Turbo-202201PNWREyV", 'name': "gpt-3.5-turbo-202201"},
}
TRENDING_AGENT_MODE = {
"blackboxai": {},
"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-405"},
'blackboxai-pro': {'mode': True, 'id': "blackboxai-pro"},
'PythonAgent': {'mode': True, 'id': "python"},
'JavaAgent': {'mode': True, 'id': "java"},
'JavaScriptAgent': {'mode': True, 'id': "javascript"},
'HTMLAgent': {'mode': True, 'id': "html"},
'GoogleCloudAgent': {'mode': True, 'id': "googlecloud"},
'AndroidDeveloper': {'mode': True, 'id': "android"},
'SwiftDeveloper': {'mode': True, 'id': "swift"},
'Next.jsAgent': {'mode': True, 'id': "next.js"},
'MongoDBAgent': {'mode': True, 'id': "mongodb"},
'PyTorchAgent': {'mode': True, 'id': "pytorch"},
'ReactAgent': {'mode': True, 'id': "react"},
'XcodeAgent': {'mode': True, 'id': "xcode"},
'AngularJSAgent': {'mode': True, 'id': "angularjs"},
'HerokuAgent': {'mode': True, 'id': "heroku"},
'GodotAgent': {'mode': True, 'id': "godot"},
'GoAgent': {'mode': True, 'id': "go"},
'GitlabAgent': {'mode': True, 'id': "gitlab"},
'GitAgent': {'mode': True, 'id': "git"},
'RepoMap': {'mode': True, 'id': "repomap"},
'FlaskAgent': {'mode': True, 'id': "flask"},
'FirebaseAgent': {'mode': True, 'id': "firebase"},
'FastAPIAgent': {'mode': True, 'id': "fastapi"},
'ErlangAgent': {'mode': True, 'id': "erlang"},
'ElectronAgent': {'mode': True, 'id': "electron"},
'DockerAgent': {'mode': True, 'id': "docker"},
'DigitalOceanAgent': {'mode': True, 'id': "digitalocean"},
'BitbucketAgent': {'mode': True, 'id': "bitbucket"},
'AzureAgent': {'mode': True, 'id': "azure"},
'FlutterAgent': {'mode': True, 'id': "flutter"},
'YoutubeAgent': {'mode': True, 'id': "youtube"},
'builderAgent': {'mode': True, 'id': "builder"},
}
# Model prefixes
MODEL_PREFIXES = {
'gpt-4o': '@GPT-4o',
'claude-sonnet-3.5': '@Claude-Sonnet-3.5',
'gemini-pro': '@Gemini-PRO',
'PythonAgent': '@python',
'JavaAgent': '@java',
'JavaScriptAgent': '@javascript',
'HTMLAgent': '@html',
'GoogleCloudAgent': '@googlecloud',
'AndroidDeveloper': '@android',
'SwiftDeveloper': '@swift',
'Next.jsAgent': '@next.js',
'MongoDBAgent': '@mongodb',
'PyTorchAgent': '@pytorch',
'ReactAgent': '@react',
'XcodeAgent': '@xcode',
'AngularJSAgent': '@angularjs',
'HerokuAgent': '@heroku',
'GodotAgent': '@godot',
'GoAgent': '@go',
'GitlabAgent': '@gitlab',
'GitAgent': '@git',
'blackboxai-pro': '@blackboxai-pro',
'FlaskAgent': '@flask',
'FirebaseAgent': '@firebase',
'FastAPIAgent': '@fastapi',
'ErlangAgent': '@erlang',
'ElectronAgent': '@electron',
'DockerAgent': '@docker',
'DigitalOceanAgent': '@digitalocean',
'BitbucketAgent': '@bitbucket',
'AzureAgent': '@azure',
'FlutterAgent': '@flutter',
'YoutubeAgent': '@youtube',
'builderAgent': '@builder',
}
# Model referers
MODEL_REFERERS = {
"blackboxai": "/?model=blackboxai",
"gpt-4o": "/?model=gpt-4o",
"gemini-pro": "/?model=gemini-pro",
"claude-sonnet-3.5": "/?model=claude-sonnet-3.5",
"blackboxai-pro": "/?model=blackboxai-pro",
}