Update api/config.py
Browse files2 unmodified lines3456789101112131415161718192021222324252627282910 unmodified lines4041424344454647484950515253545556575859606162636465666768697071722 unmodified linesload_dotenv()# Base URL and Common Headers for EditeeBASE_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',}# Header Configurations for Editee API Callsdef 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 {10 unmodified linesAPP_SECRET = os.getenv("APP_SECRET")# Default Modeldefault_model = 'claude'# Supported Modelsmodels = ['claude', 'gpt4', 'gemini', 'mistrallarge']# Model Aliasesmodel_aliases = {"claude-3.5-sonnet": "claude","gpt-4o": "gpt4","gemini-pro": "gemini","mistral-large": "mistrallarge",}# Allowed Models with ID and NameALLOWED_MODELS = [{"id": "claude", "name": "Claude"},{"id": "gpt-4o", "name": "gpt4"},{"id": "gemini", "name": "Gemini"},{"id": "mistrallarge", "name": "Mistral Large"},]# Mapping from model IDs to their canonical namesMODEL_MAPPING = {"claude": "claude","gpt4": "gpt4","gemini": "gemini","mistrallarge": "mistrallarge",}# Removed MODEL_PREFIXES, MODEL_REFERERS, and AGENT_MODE as per user instruction2 unmodified lines345678910111213141516171819202122232425262728293010 unmodified lines41424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241252 unmodified linesload_dotenv()# Base URL and Common Headers for GizAIBASE_URL = "https://app.giz.ai/assistant/"common_headers = {'Accept': 'application/json, text/plain, */*','Accept-Language': 'en-US,en;q=0.9','Cache-Control': 'no-cache','Connection': 'keep-alive','Content-Type': 'application/json','Origin': 'https://app.giz.ai','Pragma': 'no-cache','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','sec-ch-ua': '"Not?A_Brand";v="99", "Chromium";v="130"','sec-ch-ua-mobile': '?0','sec-ch-ua-platform': '"Linux"'}# Header Configurations for GizAI API Callsdef get_headers_api_chat(referer_url):return {**common_headers, 'Referer': referer_url}def get_headers_chat(chat_url, next_action, next_router_state_tree):return {10 unmodified linesAPP_SECRET = os.getenv("APP_SECRET")# Default Modeldefault_model = 'chat-gemini-flash'# Supported Chat Modelschat_models = ['chat-gemini-flash','chat-gemini-pro','chat-gpt4m','chat-gpt4','claude-sonnet','claude-haiku','llama-3-70b','llama-3-8b','mistral-large','chat-o1-mini']# Supported Image Modelsimage_models = ['flux1','sdxl','sd','sd35',]# Combined Models Listmodels = [*chat_models, *image_models]# Model Aliasesmodel_aliases = {# Chat model aliases"gemini-flash": "chat-gemini-flash","gemini-pro": "chat-gemini-pro","gpt-4o-mini": "chat-gpt4m","gpt-4o": "chat-gpt4","claude-3.5-sonnet": "claude-sonnet","claude-3-haiku": "claude-haiku","llama-3.1-70b": "llama-3-70b","llama-3.1-8b": "llama-3-8b","o1-mini": "chat-o1-mini",# Image model aliases"sd-1.5": "sd","sd-3.5": "sd35","flux-schnell": "flux1",}# Allowed Models with ID and NameALLOWED_MODELS = [{"id": "chat-gemini-flash", "name": "Chat Gemini Flash"},{"id": "chat-gemini-pro", "name": "Chat Gemini Pro"},{"id": "chat-gpt4m", "name": "Chat GPT-4m"},{"id": "chat-gpt4", "name": "Chat GPT-4"},{"id": "claude-sonnet", "name": "Claude Sonnet"},{"id": "claude-haiku", "name": "Claude Haiku"},{"id": "llama-3-70b", "name": "LLaMA 3-70B"},{"id": "llama-3-8b", "name": "LLaMA 3-8B"},{"id": "mistral-large", "name": "Mistral Large"},{"id": "chat-o1-mini", "name": "Chat O1 Mini"},{"id": "flux1", "name": "Flux1"},{"id": "sdxl", "name": "SDXL"},{"id": "sd", "name": "SD"},{"id": "sd35", "name": "SD35"},]# Mapping from model IDs to their canonical namesMODEL_MAPPING = {"chat-gemini-flash": "chat-gemini-flash","chat-gemini-pro": "chat-gemini-pro","chat-gpt4m": "chat-gpt4m","chat-gpt4": "chat-gpt4","claude-sonnet": "claude-sonnet","claude-haiku": "claude-haiku","llama-3-70b": "llama-3-70b","llama-3-8b": "llama-3-8b","mistral-large": "mistral-large","chat-o1-mini": "chat-o1-mini","flux1": "flux1","sdxl": "sdxl","sd": "sd","sd35": "sd35",}# Removed MODEL_PREFIXES, MODEL_REFERERS, and AGENT_MODE as per user instruction
api/config.py+84-31