Spaces:
Sleeping
Sleeping
doc: 更新使用json设置配置方式
Browse files- 同时加入了wiki的链接。
* chore: 更新config_example
Co-authored-by: AneonCode <[email protected]>
Co-authored-by: insight_proxmox <[email protected]>
- README.md +20 -18
- config_example.json +6 -5
README.md
CHANGED
|
@@ -87,38 +87,32 @@
|
|
| 87 |
|
| 88 |
2. **填写API密钥**
|
| 89 |
|
| 90 |
-
以下
|
| 91 |
|
| 92 |
<details><summary>1. 在图形界面中填写你的API密钥</summary>
|
| 93 |
|
| 94 |
这样设置的密钥会在页面刷新后被清除。
|
| 95 |
|
| 96 |
<img width="760" alt="image" src="https://user-images.githubusercontent.com/51039745/222873756-3858bb82-30b9-49bc-9019-36e378ee624d.png"></details>
|
| 97 |
-
<details><summary>2. 在直接代码中填入你的 OpenAI API 密钥</summary>
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
这样设置的密钥可以在拉取项目更新之后保留。
|
| 106 |
-
|
| 107 |
-
在项目文件夹中新建这两个文件:`api_key.txt` 和 `auth.json`。
|
| 108 |
-
|
| 109 |
-
在`api_key.txt`中填写你的API-Key,注意不要填写任何无关内容。
|
| 110 |
-
|
| 111 |
-
在`auth.json`中填写你的用户名和密码,支持多用户。格式如下:
|
| 112 |
|
| 113 |
```
|
| 114 |
{
|
| 115 |
-
"
|
| 116 |
-
|
| 117 |
-
"
|
| 118 |
-
|
|
|
|
| 119 |
}
|
| 120 |
```
|
| 121 |
|
|
|
|
|
|
|
| 122 |
</details>
|
| 123 |
|
| 124 |
3. **安装依赖**
|
|
@@ -137,7 +131,7 @@
|
|
| 137 |
|
| 138 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
| 139 |
|
| 140 |
-
如果下载慢,建议[配置清华源](https://mirrors.tuna.tsinghua.edu.cn/help/pypi/)
|
| 141 |
|
| 142 |
4. **启动**
|
| 143 |
|
|
@@ -154,6 +148,7 @@
|
|
| 154 |
```
|
| 155 |
|
| 156 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
|
|
|
| 157 |
<br />
|
| 158 |
|
| 159 |
如果一切顺利,现在,你应该已经可以在浏览器地址栏中输入 [`http://localhost:7860`](http://localhost:7860) 查看并使用 ChuanhuChatGPT 了。
|
|
@@ -343,6 +338,13 @@ docker run -d --name chatgpt \
|
|
| 343 |
|
| 344 |
该页面列出了**几乎所有**您可能遇到的各种问题,包括如何配置代理,以及遇到问题后您该采取的措施,**请务必认真阅读**。
|
| 345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
## Starchart
|
| 347 |
|
| 348 |
[](https://star-history.com/#GaiZhenbiao/ChuanhuChatGPT&Date)
|
|
|
|
| 87 |
|
| 88 |
2. **填写API密钥**
|
| 89 |
|
| 90 |
+
以下2种方法任选其一:
|
| 91 |
|
| 92 |
<details><summary>1. 在图形界面中填写你的API密钥</summary>
|
| 93 |
|
| 94 |
这样设置的密钥会在页面刷新后被清除。
|
| 95 |
|
| 96 |
<img width="760" alt="image" src="https://user-images.githubusercontent.com/51039745/222873756-3858bb82-30b9-49bc-9019-36e378ee624d.png"></details>
|
|
|
|
| 97 |
|
| 98 |
+
<details><summary>2. 在文件中设定默认密钥、用户名密码以及更多设置(推荐)</summary>
|
| 99 |
|
| 100 |
+
这样设置的密钥以及其他设置项可以在拉取项目更新之后保留。
|
| 101 |
|
| 102 |
+
在项目文件夹中复制一份 `config_example.json`,并将其重命名为 `config.json`,在其中填入 API-Key、用户名密码(可选)、API host(可选)、代理地址(可选)等设置。用户名密码支持多用户。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
```
|
| 105 |
{
|
| 106 |
+
"openai_api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxx",
|
| 107 |
+
"users": [
|
| 108 |
+
["username-0", "password-0"],
|
| 109 |
+
["username-1", "password-1"]
|
| 110 |
+
],
|
| 111 |
}
|
| 112 |
```
|
| 113 |
|
| 114 |
+
* *原本在 `api_key.txt` 和 `auth.json` 中填写相关设置的方法仍然可用,但不再推荐。*
|
| 115 |
+
|
| 116 |
</details>
|
| 117 |
|
| 118 |
3. **安装依赖**
|
|
|
|
| 131 |
|
| 132 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
| 133 |
|
| 134 |
+
如果下载慢,建议[配置清华源](https://mirrors.tuna.tsinghua.edu.cn/help/pypi/)(但清华镜像部分包版本可能落后于官方源),或者科学上网。
|
| 135 |
|
| 136 |
4. **启动**
|
| 137 |
|
|
|
|
| 148 |
```
|
| 149 |
|
| 150 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
| 151 |
+
|
| 152 |
<br />
|
| 153 |
|
| 154 |
如果一切顺利,现在,你应该已经可以在浏览器地址栏中输入 [`http://localhost:7860`](http://localhost:7860) 查看并使用 ChuanhuChatGPT 了。
|
|
|
|
| 338 |
|
| 339 |
该页面列出了**几乎所有**您可能遇到的各种问题,包括如何配置代理,以及遇到问题后您该采取的措施,**请务必认真阅读**。
|
| 340 |
|
| 341 |
+
## 了解更多
|
| 342 |
+
|
| 343 |
+
若需了解更多信息,请查看我们的 [wiki](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki):
|
| 344 |
+
|
| 345 |
+
- [想要做出贡献?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/贡献指南)
|
| 346 |
+
- [项目更新情况?](https://github.com/GaiZhenbiao/ChuanhuChatGPT/wiki/更新日志)
|
| 347 |
+
|
| 348 |
## Starchart
|
| 349 |
|
| 350 |
[](https://star-history.com/#GaiZhenbiao/ChuanhuChatGPT&Date)
|
config_example.json
CHANGED
|
@@ -2,13 +2,14 @@
|
|
| 2 |
"openai_api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxx",
|
| 3 |
"https_proxy": "http://127.0.0.1:1079",
|
| 4 |
"http_proxy": "http://127.0.0.1:1079",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"advance_docs": {
|
| 6 |
"pdf": {
|
| 7 |
-
"two_column":
|
| 8 |
"formula_ocr": true
|
| 9 |
}
|
| 10 |
-
}
|
| 11 |
-
"users": [
|
| 12 |
-
["root", "root"]
|
| 13 |
-
]
|
| 14 |
}
|
|
|
|
| 2 |
"openai_api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxx",
|
| 3 |
"https_proxy": "http://127.0.0.1:1079",
|
| 4 |
"http_proxy": "http://127.0.0.1:1079",
|
| 5 |
+
"users": [
|
| 6 |
+
["username-0", "password-0"],
|
| 7 |
+
["username-1", "password-1"]
|
| 8 |
+
],
|
| 9 |
"advance_docs": {
|
| 10 |
"pdf": {
|
| 11 |
+
"two_column": false,
|
| 12 |
"formula_ocr": true
|
| 13 |
}
|
| 14 |
+
}
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|