-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py.example
54 lines (40 loc) · 1.21 KB
/
config.py.example
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@File : config.py
@Time : 2023/10/09 19:48:20
@Author : lvguanjun
@Desc : config.py
"""
import subprocess
import redis
DEBUG_MODULE = True
redis_config = {
"host": "127.0.0.1",
"db": 1,
"port": 6379,
"decode_responses": True,
}
redis_cli = redis.Redis(**redis_config)
gpt3_redis_cli = redis.Redis(**redis_config)
gpt3_redis_cli.select(2)
# token提前过期时间
TOKEN_EXPIRE_EXTRA_TIME = 432000 # 5天
# refresh 提前刷新时间
REFRESH_EXTRA_TIME = -1 # 刷新所有token
# datetime格式
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
# 代理,针对 wsl2 配置,个人无需配置设置为 None 即可
output = subprocess.check_output(
'cat /etc/resolv.conf | grep "nameserver" | cut -f 2 -d " "', shell=True
)
host_ip = output.decode().strip()
PROXY = f"http://{host_ip}:7890"
# share token 唯一标识
SHARE_TOKEN_UNIQUE_NAME = "xxxx"
# 需要更新的 pool token,为 None 则生成新的 pool token
POOL_TOKEN = "pk-***"
# 登录接口的url
LOGIN_URL = "https://ai.fakeopen.com/api/login"
# base_url,fakeopen全面关停,需要自建 pandora-next 的 proxy 模式
BASE_URL = "https://ai.fakeopen.com/<proxy_api_prefix>"