File size: 5,945 Bytes
6a247c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5097e8
 
6a247c1
 
 
 
 
 
 
 
 
 
 
f5097e8
6a247c1
 
f5097e8
6a247c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import os
from dotenv import load_dotenv

load_dotenv()

# Base URL and Common Headers
BASE_URL = "https://www.blackbox.ai"
common_headers = {
    'accept': '*/*',
    'accept-language': 'en-US,en;q=0.9',
    'cache-control': 'no-cache',
    'origin': BASE_URL,
    'pragma': 'no-cache',
    '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/130.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": "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": "PythonAgent"},
    {"id": "JavaAgent", "name": "JavaAgent"},
    {"id": "JavaScriptAgent", "name": "JavaScriptAgent"},
    {"id": "HTMLAgent", "name": "HTMLAgent"},
    {"id": "GoogleCloudAgent", "name": "GoogleCloudAgent"},
    {"id": "AndroidDeveloper", "name": "AndroidDeveloper"},
    {"id": "SwiftDeveloper", "name": "SwiftDeveloper"},
    {"id": "Next.jsAgent", "name": "Next.jsAgent"},
    {"id": "MongoDBAgent", "name": "MongoDBAgent"},
    {"id": "PyTorchAgent", "name": "PyTorchAgent"},
    {"id": "ReactAgent", "name": "ReactAgent"},
    {"id": "XcodeAgent", "name": "XcodeAgent"},
    {"id": "AngularJSAgent", "name": "AngularJSAgent"},
    {"id": "HerokuAgent", "name": "HerokuAgent"},
    {"id": "GodotAgent", "name": "GodotAgent"},
    {"id": "GoAgent", "name": "GoAgent"},
    {"id": "GitlabAgent", "name": "GitlabAgent"},
    {"id": "GitAgent", "name": "GitAgent"},
    {"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"},
    # Added New Agents
    {"id": "FlaskAgent", "name": "FlaskAgent"},
    {"id": "FirebaseAgent", "name": "FirebaseAgent"},
    {"id": "FastAPIAgent", "name": "FastAPIAgent"},
    {"id": "ErlangAgent", "name": "ErlangAgent"},
    {"id": "ElectronAgent", "name": "ElectronAgent"},
    {"id": "DockerAgent", "name": "DockerAgent"},
    {"id": "DigitalOceanAgent", "name": "DigitalOceanAgent"},
    {"id": "BitbucketAgent", "name": "BitbucketAgent"},
    {"id": "AzureAgent", "name": "AzureAgent"},
    {"id": "FlutterAgent", "name": "FlutterAgent"},
    {"id": "YoutubeAgent", "name": "YoutubeAgent"},
    {"id": "builderAgent", "name": "builderAgent"},
]


MODEL_MAPPING = {model["id"]: model["name"] for model in ALLOWED_MODELS}

# 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"},
}

TRENDING_AGENT_MODE = {
    model["id"]: {'mode': True, 'id': model["name"]} for model in ALLOWED_MODELS
}


# Model prefixes
MODEL_PREFIXES = {
    'gpt-4o': '@GPT-4o',
    'gemini-pro': '@Gemini-PRO',
    'PythonAgent': '@Python Agent',
    'JavaAgent': '@Java Agent',
    'JavaScriptAgent': '@JavaScript Agent',
    'HTMLAgent': '@HTML Agent',
    'GoogleCloudAgent': '@Google Cloud Agent',
    'AndroidDeveloper': '@Android Developer',
    'SwiftDeveloper': '@Swift Developer',
    'Next.jsAgent': '@Next.js Agent',
    'MongoDBAgent': '@MongoDB Agent',
    'PyTorchAgent': '@PyTorch Agent',
    'ReactAgent': '@React Agent',
    'XcodeAgent': '@Xcode Agent',
    'AngularJSAgent': '@AngularJS Agent',
    'HerokuAgent': '@Heroku Agent',
    'GodotAgent': '@Godot Agent',
    'GoAgent': '@Go Agent',
    'GitlabAgent': '@Gitlab Agent',
    'GitAgent': '@Gitlab Agent',
    'blackboxai-pro': '@BLACKBOXAI-PRO',
    'flux': '@Image Generation',
    # Added New Agents
    'FlaskAgent': '@Flask Agent',
    'FirebaseAgent': '@Firebase Agent',
    'FastAPIAgent': '@FastAPI Agent',
    'ErlangAgent': '@Erlang Agent',
    'ElectronAgent': '@Electron Agent',
    'DockerAgent': '@Docker Agent',
    'DigitalOceanAgent': '@DigitalOcean Agent',
    'BitbucketAgent': '@Bitbucket Agent',
    'AzureAgent': '@Azure Agent',
    'FlutterAgent': '@Flutter Agent',
    'YoutubeAgent': '@Youtube Agent',
    'builderAgent': '@builder Agent',
}