File size: 7,834 Bytes
42a12ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import os
from dotenv import load_dotenv

load_dotenv()

# Base URL
BASE_URL = "https://www.blackbox.ai"

# Headers Configuration (Updated to use new headers)
def get_headers():
    return {
        'accept': '*/*',
        'accept-language': 'en-US,en;q=0.9',
        'cache-control': 'no-cache',
        'content-type': 'application/json',
        'origin': f"{BASE_URL}",
        'pragma': 'no-cache',
        'priority': 'u=1, i',
        'referer': f"{BASE_URL}/",
        'sec-ch-ua': '"Not?A_Brand";v="99", "Chromium";v="130"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"Linux"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'same-origin',
        'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) '
                      'AppleWebKit/537.36 (KHTML, like Gecko) '
                      'Chrome/130.0.0.0 Safari/537.36',
    }

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"},
    
    # 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 = {
    "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",
    "gemini-pro": "gemini-pro",
    "gemini-1.5-flash": "gemini-1.5-flash",
    "claude-sonnet-3.5": "claude-sonnet-3.5",
    "PythonAgent": "PythonAgent",
    "JavaAgent": "JavaAgent",
    "JavaScriptAgent": "JavaScriptAgent",
    "HTMLAgent": "HTMLAgent",
    "GoogleCloudAgent": "GoogleCloudAgent",
    "AndroidDeveloper": "AndroidDeveloper",
    "SwiftDeveloper": "SwiftDeveloper",
    "Next.jsAgent": "Next.jsAgent",
    "MongoDBAgent": "MongoDBAgent",
    "PyTorchAgent": "PyTorchAgent",
    "ReactAgent": "ReactAgent",
    "XcodeAgent": "XcodeAgent",
    "AngularJSAgent": "AngularJSAgent",
    "HerokuAgent": "HerokuAgent",
    "GodotAgent": "GodotAgent",
    "GoAgent": "GoAgent",
    "GitlabAgent": "GitlabAgent",
    "GitAgent": "GitAgent",
    "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",
    
    # Added New Agents
    "FlaskAgent": "FlaskAgent",
    "FirebaseAgent": "FirebaseAgent",
    "FastAPIAgent": "FastAPIAgent",
    "ErlangAgent": "ErlangAgent",
    "ElectronAgent": "ElectronAgent",
    "DockerAgent": "DockerAgent",
    "DigitalOceanAgent": "DigitalOceanAgent",
    "BitbucketAgent": "BitbucketAgent",
    "AzureAgent": "AzureAgent",
    "FlutterAgent": "FlutterAgent",
    "YoutubeAgent": "YoutubeAgent",
    "builderAgent": "builderAgent",
}

# Agent modes (No changes needed)
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"},
}

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 Agent"},
    'JavaAgent': {'mode': True, 'id': "Java Agent"},
    'JavaScriptAgent': {'mode': True, 'id': "JavaScript Agent"},
    'HTMLAgent': {'mode': True, 'id': "HTML Agent"},
    'GoogleCloudAgent': {'mode': True, 'id': "Google Cloud Agent"},
    'AndroidDeveloper': {'mode': True, 'id': "Android Developer"},
    'SwiftDeveloper': {'mode': True, 'id': "Swift Developer"},
    'Next.jsAgent': {'mode': True, 'id': "Next.js Agent"},
    'MongoDBAgent': {'mode': True, 'id': "MongoDB Agent"},
    'PyTorchAgent': {'mode': True, 'id': "PyTorch Agent"},
    'ReactAgent': {'mode': True, 'id': "React Agent"},
    'XcodeAgent': {'mode': True, 'id': "Xcode Agent"},
    'AngularJSAgent': {'mode': True, 'id': "AngularJS Agent"},
    'HerokuAgent': {'mode': True, 'id': "Heroku Agent"},
    'GodotAgent': {'mode': True, 'id': "Godot Agent"},
    'GoAgent': {'mode': True, 'id': "Go Agent"},
    'GitlabAgent': {'mode': True, 'id': "Gitlab Agent"},
    'GitAgent': {'mode': True, 'id': "Git Agent"},
    'RepoMap': {'mode': True, 'id': "repomap"},
    
    # Added New Agents
    'FlaskAgent': {'mode': True, 'id': "Flask Agent"},
    'FirebaseAgent': {'mode': True, 'id': "Firebase Agent"},
    'FastAPIAgent': {'mode': True, 'id': "FastAPI Agent"},
    'ErlangAgent': {'mode': True, 'id': "Erlang Agent"},
    'ElectronAgent': {'mode': True, 'id': "Electron Agent"},
    'DockerAgent': {'mode': True, 'id': "Docker Agent"},
    'DigitalOceanAgent': {'mode': True, 'id': "DigitalOcean Agent"},
    'BitbucketAgent': {'mode': True, 'id': "Bitbucket Agent"},
    'AzureAgent': {'mode': True, 'id': "Azure Agent"},
    'FlutterAgent': {'mode': True, 'id': "Flutter Agent"},
    'YoutubeAgent': {'mode': True, 'id': "Youtube Agent"},
    'builderAgent': {'mode': True, 'id': "builder Agent"},
}

# Removed MODEL_PREFIXES and MODEL_REFERERS as per your request