|
import os |
|
from dotenv import load_dotenv |
|
|
|
load_dotenv() |
|
|
|
|
|
BASE_URL = "https://editee.com" |
|
common_headers = { |
|
'accept': 'application/json, text/plain, */*', |
|
'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="129", "Not=A?Brand";v="8"', |
|
'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/129.0.0.0 Safari/537.36', |
|
} |
|
|
|
|
|
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") |
|
|
|
|
|
default_model = 'claude' |
|
|
|
|
|
models = ['claude', 'gpt4', 'gemini', 'mistrallarge'] |
|
|
|
|
|
model_aliases = { |
|
"claude-3.5-sonnet": "claude", |
|
"gpt-4o": "gpt4", |
|
"gemini-pro": "gemini", |
|
"mistral-large": "mistrallarge", |
|
} |
|
|
|
|
|
ALLOWED_MODELS = [ |
|
{"id": "claude", "name": "Claude"}, |
|
{"id": "gpt4", "name": "GPT-4"}, |
|
{"id": "gemini", "name": "Gemini"}, |
|
{"id": "mistrallarge", "name": "Mistral Large"}, |
|
] |
|
|
|
|
|
MODEL_MAPPING = { |
|
"claude": "claude", |
|
"gpt4": "gpt4", |
|
"gemini": "gemini", |
|
"mistrallarge": "mistrallarge", |
|
} |
|
|
|
|
|
|