Niansuh commited on
Commit
5d00ccd
·
verified ·
1 Parent(s): d70398c

Update api/config.py

Browse files
Files changed (1) hide show
  1. api/config.py +36 -28
api/config.py CHANGED
@@ -3,30 +3,33 @@ from dotenv import load_dotenv
3
 
4
  load_dotenv()
5
 
6
- # Base URL and 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
- 'priority': 'u=1, i',
15
- 'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
16
- 'sec-ch-ua-mobile': '?0',
17
- 'sec-ch-ua-platform': '"Windows"',
18
- 'sec-fetch-dest': 'empty',
19
- 'sec-fetch-mode': 'cors',
20
- 'sec-fetch-site': 'same-origin',
21
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
22
- 'AppleWebKit/537.36 (KHTML, like Gecko) '
23
- 'Chrome/130.0.0.0 Safari/537.36',
24
- }
25
 
26
- # Header Configurations for Specific API Calls
27
- def get_headers_api_chat(referer_url):
28
- return {**common_headers, 'Content-Type': 'application/json', 'Referer': referer_url}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
 
30
  APP_SECRET = os.getenv("APP_SECRET")
31
 
32
  ALLOWED_MODELS = [
@@ -40,20 +43,25 @@ ALLOWED_MODELS = [
40
  {"id": "gemini-pro", "name": "gemini-pro"},
41
  {"id": "gemini-1.5-flash", "name": "gemini-1.5-flash"},
42
  {"id": "claude-sonnet-3.5", "name": "claude-sonnet-3.5"},
43
- # Add any additional models here
 
44
  ]
45
 
 
 
 
 
46
  AGENT_MODE = {
47
  'flux': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "flux"},
48
- # Add other agent modes as needed
 
49
  }
50
 
51
  TRENDING_AGENT_MODE = {
52
  "blackboxai": {},
53
  "gemini-1.5-flash": {'mode': True, 'id': 'Gemini'},
54
  "llama-3.1-8b": {'mode': True, 'id': "llama-3.1-8b"},
55
- "llama-3.1-70b": {'mode': True, 'id': "llama-3.1-70b"},
56
- "llama-3.1-405b": {'mode': True, 'id': "llama-3.1-405"},
57
- "blackboxai-pro": {'mode': True, 'id': "BLACKBOXAI-PRO"},
58
- # Add other trending agent modes as needed
59
- }
 
3
 
4
  load_dotenv()
5
 
6
+ # Base URL and endpoint configurations
7
  BASE_URL = "https://www.blackbox.ai"
8
+ API_ENDPOINT = f"{BASE_URL}/api/chat"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ # Custom headers for requests
11
+ def get_headers():
12
+ return {
13
+ 'accept': '*/*',
14
+ 'accept-language': 'en-US,en;q=0.9',
15
+ 'cache-control': 'no-cache',
16
+ 'content-type': 'application/json',
17
+ 'origin': BASE_URL,
18
+ 'pragma': 'no-cache',
19
+ 'priority': 'u=1, i',
20
+ 'referer': f'{BASE_URL}/',
21
+ 'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
22
+ 'sec-ch-ua-mobile': '?0',
23
+ 'sec-ch-ua-platform': '"Windows"',
24
+ 'sec-fetch-dest': 'empty',
25
+ 'sec-fetch-mode': 'cors',
26
+ 'sec-fetch-site': 'same-origin',
27
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
28
+ 'AppleWebKit/537.36 (KHTML, like Gecko) '
29
+ 'Chrome/130.0.0.0 Safari/537.36',
30
+ }
31
 
32
+ # Model configurations
33
  APP_SECRET = os.getenv("APP_SECRET")
34
 
35
  ALLOWED_MODELS = [
 
43
  {"id": "gemini-pro", "name": "gemini-pro"},
44
  {"id": "gemini-1.5-flash", "name": "gemini-1.5-flash"},
45
  {"id": "claude-sonnet-3.5", "name": "claude-sonnet-3.5"},
46
+ {"id": "PythonAgent", "name": "PythonAgent"},
47
+ # Other models...
48
  ]
49
 
50
+ # Mapping of models for streamlined access
51
+ MODEL_MAPPING = {model['id']: model['name'] for model in ALLOWED_MODELS}
52
+
53
+ # Agent modes
54
  AGENT_MODE = {
55
  'flux': {'mode': True, 'id': "ImageGenerationLV45LJp", 'name': "flux"},
56
+ 'Niansuh': {'mode': True, 'id': "NiansuhAIk1HgESy", 'name': "Niansuh"},
57
+ 'o1-preview': {'mode': True, 'id': "o1Dst8La8", 'name': "o1-preview"},
58
  }
59
 
60
  TRENDING_AGENT_MODE = {
61
  "blackboxai": {},
62
  "gemini-1.5-flash": {'mode': True, 'id': 'Gemini'},
63
  "llama-3.1-8b": {'mode': True, 'id': "llama-3.1-8b"},
64
+ 'llama-3.1-70b': {'mode': True, 'id': "llama-3.1-70b"},
65
+ # Other agent modes...
66
+ }
67
+