File size: 2,064 Bytes
6331a12
 
 
 
 
d94491c
 
6331a12
d94491c
6331a12
 
 
 
 
d94491c
6331a12
d94491c
6331a12
 
 
d94491c
6331a12
 
d94491c
6331a12
 
 
 
 
 
 
 
 
 
 
 
 
 
d94491c
6331a12
 
d94491c
 
6331a12
d94491c
 
6331a12
d94491c
 
 
 
 
 
6331a12
 
d94491c
 
 
 
 
 
 
6331a12
d94491c
 
 
 
 
 
6331a12
 
d94491c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import os
from dotenv import load_dotenv

load_dotenv()

# Base URL and Common Headers for Editee
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',
}

# Header Configurations for Editee API Calls
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': '/',
    }

# Application Secret for Authentication
APP_SECRET = os.getenv("APP_SECRET")

# Default Model
default_model = 'claude'

# Supported Models
models = ['claude', 'gpt4', 'gemini', 'mistrallarge']

# Model Aliases
model_aliases = {
    "claude-3.5-sonnet": "claude",
    "gpt-4o": "gpt4",
    "gemini-pro": "gemini",
    "mistral-large": "mistrallarge",
}

# Allowed Models with ID and Name
ALLOWED_MODELS = [
    {"id": "claude", "name": "Claude"},
    {"id": "gpt4", "name": "GPT-4"},
    {"id": "gemini", "name": "Gemini"},
    {"id": "mistrallarge", "name": "Mistral Large"},
]

# Mapping from model IDs to their canonical names
MODEL_MAPPING = {
    "claude": "claude",
    "gpt4": "gpt4",
    "gemini": "gemini",
    "mistrallarge": "mistrallarge",
}

# Removed MODEL_PREFIXES, MODEL_REFERERS, and AGENT_MODE as per user instruction