Niansuh commited on
Commit
6ce1f12
·
verified ·
1 Parent(s): d25e8ce

Update api/config.py

Browse files
Files changed (1) hide show
  1. api/config.py +17 -0
api/config.py CHANGED
@@ -27,6 +27,23 @@ common_headers = {
27
  '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',
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  APP_SECRET = os.getenv("APP_SECRET")
31
 
32
  ALLOWED_MODELS = [
 
27
  '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',
28
  }
29
 
30
+
31
+ # Header Configurations for Specific API Calls
32
+ def get_headers_api_chat(referer_url):
33
+ return {**common_headers, 'Content-Type': 'application/json', 'Referer': referer_url}
34
+
35
+ def get_headers_chat(chat_url, next_action, next_router_state_tree):
36
+ return {
37
+ **common_headers,
38
+ 'Accept': 'text/x-component',
39
+ 'Content-Type': 'text/plain;charset=UTF-8',
40
+ 'Referer': chat_url,
41
+ 'next-action': next_action,
42
+ 'next-router-state-tree': next_router_state_tree,
43
+ 'next-url': '/',
44
+ }
45
+
46
+
47
  APP_SECRET = os.getenv("APP_SECRET")
48
 
49
  ALLOWED_MODELS = [