Niansuh commited on
Commit
e460d39
·
verified ·
1 Parent(s): 16e0b17

Update api/config.py

Browse files
Files changed (1) hide show
  1. api/config.py +23 -17
api/config.py CHANGED
@@ -1,23 +1,32 @@
 
 
1
  import os
2
  from dotenv import load_dotenv
3
 
4
  load_dotenv()
5
 
6
- # Base URL and Simplified Common Headers
7
  BASE_URL = "https://www.blackbox.ai"
8
- common_headers = {
9
- 'accept': '*/*',
10
- 'accept-language': 'en-US,en;q=0.9',
11
- 'cache-control': 'no-cache',
12
- 'origin': BASE_URL,
13
- 'pragma': 'no-cache',
14
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
15
- 'AppleWebKit/537.36 (KHTML, like Gecko) '
16
- 'Chrome/130.0.0.0 Safari/537.36',
 
 
 
 
 
17
  }
18
 
 
19
  APP_SECRET = os.getenv("APP_SECRET")
20
 
 
21
  ALLOWED_MODELS = [
22
  {"id": "blackboxai", "name": "blackboxai"},
23
  {"id": "blackboxai-pro", "name": "blackboxai-pro"},
@@ -70,11 +79,12 @@ ALLOWED_MODELS = [
70
  {"id": "builderAgent", "name": "builderAgent"},
71
  ]
72
 
 
73
  MODEL_MAPPING = {
74
  "blackboxai": "blackboxai",
75
  "blackboxai-pro": "blackboxai-pro",
76
  "flux": "flux",
77
- "ImageGeneration": "flux",
78
  "llama-3.1-8b": "llama-3.1-8b",
79
  "llama-3.1-70b": "llama-3.1-70b",
80
  "llama-3.1-405b": "llama-3.1-405",
@@ -101,7 +111,6 @@ MODEL_MAPPING = {
101
  "GitlabAgent": "GitlabAgent",
102
  "GitAgent": "GitAgent",
103
  "RepoMap": "RepoMap",
104
- # Additional mappings
105
  "gemini-flash": "gemini-1.5-flash",
106
  "claude-3.5-sonnet": "claude-sonnet-3.5",
107
  "flux": "flux",
@@ -127,13 +136,14 @@ MODEL_MAPPING = {
127
  "builderAgent": "builderAgent",
128
  }
129
 
130
- # Agent modes
131
  AGENT_MODE = {
132
  'flux': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "flux"},
133
  'Niansuh': {'mode': True, 'id': "NiansuhAIk1HgESy", 'name': "Niansuh"},
134
  'o1-preview': {'mode': True, 'id': "o1Dst8La8", 'name': "o1-preview"},
135
  }
136
 
 
137
  TRENDING_AGENT_MODE = {
138
  "blackboxai": {},
139
  "gemini-1.5-flash": {'mode': True, 'id': 'Gemini'},
@@ -175,7 +185,3 @@ TRENDING_AGENT_MODE = {
175
  'YoutubeAgent': {'mode': True, 'id': "YoutubeAgent"},
176
  'builderAgent': {'mode': True, 'id': "builderAgent"},
177
  }
178
-
179
- # Removed MODEL_PREFIXES and MODEL_REFERERS as per requirements
180
-
181
- # No header configuration functions are included since extra headers are to be removed
 
1
+ # config.py
2
+
3
  import os
4
  from dotenv import load_dotenv
5
 
6
  load_dotenv()
7
 
8
+ # Base URL for the Blackbox AI API
9
  BASE_URL = "https://www.blackbox.ai"
10
+
11
+ # Simplified Common Headers
12
+ COMMON_HEADERS = {
13
+ 'Accept': '*/*',
14
+ 'Accept-Language': 'en-US,en;q=0.9',
15
+ 'Cache-Control': 'no-cache',
16
+ 'Origin': BASE_URL,
17
+ 'Pragma': 'no-cache',
18
+ 'User-Agent': (
19
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
20
+ 'AppleWebKit/537.36 (KHTML, like Gecko) '
21
+ 'Chrome/130.0.0.0 Safari/537.36'
22
+ ),
23
+ 'Content-Type': 'application/json',
24
  }
25
 
26
+ # Application Secret (ensure this is set in your .env file)
27
  APP_SECRET = os.getenv("APP_SECRET")
28
 
29
+ # Allowed Models
30
  ALLOWED_MODELS = [
31
  {"id": "blackboxai", "name": "blackboxai"},
32
  {"id": "blackboxai-pro", "name": "blackboxai-pro"},
 
79
  {"id": "builderAgent", "name": "builderAgent"},
80
  ]
81
 
82
+ # Model Mapping for Aliases
83
  MODEL_MAPPING = {
84
  "blackboxai": "blackboxai",
85
  "blackboxai-pro": "blackboxai-pro",
86
  "flux": "flux",
87
+ "Image Generation": "flux",
88
  "llama-3.1-8b": "llama-3.1-8b",
89
  "llama-3.1-70b": "llama-3.1-70b",
90
  "llama-3.1-405b": "llama-3.1-405",
 
111
  "GitlabAgent": "GitlabAgent",
112
  "GitAgent": "GitAgent",
113
  "RepoMap": "RepoMap",
 
114
  "gemini-flash": "gemini-1.5-flash",
115
  "claude-3.5-sonnet": "claude-sonnet-3.5",
116
  "flux": "flux",
 
136
  "builderAgent": "builderAgent",
137
  }
138
 
139
+ # Agent Modes
140
  AGENT_MODE = {
141
  'flux': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "flux"},
142
  'Niansuh': {'mode': True, 'id': "NiansuhAIk1HgESy", 'name': "Niansuh"},
143
  'o1-preview': {'mode': True, 'id': "o1Dst8La8", 'name': "o1-preview"},
144
  }
145
 
146
+ # Trending Agent Modes
147
  TRENDING_AGENT_MODE = {
148
  "blackboxai": {},
149
  "gemini-1.5-flash": {'mode': True, 'id': 'Gemini'},
 
185
  'YoutubeAgent': {'mode': True, 'id': "YoutubeAgent"},
186
  'builderAgent': {'mode': True, 'id': "builderAgent"},
187
  }