-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup-QChatGPT.sh
62 lines (47 loc) · 1.25 KB
/
setup-QChatGPT.sh
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
#!/bin/bash
# Copyright (C) 2024 shmilee
DIST_path=~/qq-QChatGPT
LABEL=QChatGPT
# install for ~user
python3 -m venv "$DIST_path" --prompt $LABEL
sed -e "/PS1=.*($LABEL)/ s/PS1/#PS1/" \
-e "/PS1=.*($LABEL)/a\ PS1=\"\$(echo \"\${PS1:-}\" \| sed 's\|^\|($LABEL)\|g')\"" \
-i $DIST_path/bin/activate
source "$DIST_path/bin/activate"
cd "$DIST_path"
git clone --depth 1 https://github.com/RockChinQ/QChatGPT
python3 -m pip install -r QChatGPT/requirements.txt
# 配置
cat << EOF
QChatGPT/data/config/platform.json
{
"adapter": "aiocqhttp",
"enable": true,
"host": "127.0.0.1",
"port": 9574,
"access-token": ""
},
"force-delay": [1, 5],
QChatGPT/data/config/provider.json
"keys": {
"openai": [
"sk-AAAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCCCCCDDDDDDDDD"
],
"anthropic": [],
"moonshot": [],
"deepseek": []
},
"openai-chat-completions": {
"base-url": "https://api.chatanywhere.com.cn/v1",
"args": {},
"timeout": 120
},
"model": "gpt-4o-mini",
QChatGPT/data/config/system.json
"admin-sessions": [
"person_9xxxxxxxx"
],
EOF
# start
cd QChatGPT/
python3 main.py