Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@

**部署过程中遇到任何问题,请先在[QChatGPT](https://github.com/RockChinQ/QChatGPT/issues)或[qcg-installer](https://github.com/RockChinQ/qcg-installer/issues)的issue里进行搜索**

> **❗部署完成后必看: [指令说明](https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4)❗**

### - 注册OpenAI账号

> 若您要直接使用非OpenAI的模型(如New Bing),可跳过此步骤,直接进行之后的部署,完成后按照相关插件的文档进行配置即可
Expand Down Expand Up @@ -214,7 +212,8 @@ python3 main.py

## 🚀使用

查看[Wiki功能使用页](https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)
**部署完成后必看: [指令说明](https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4)**
所有功能查看[Wiki功能使用页](https://github.com/RockChinQ/QChatGPT/wiki/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)

## 🧩插件生态

Expand Down
2 changes: 1 addition & 1 deletion pkg/audit/gatherer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def report_to_server(self, subservice_name: str, count: int):
config = pkg.utils.context.get_config()
if hasattr(config, "report_usage") and not config.report_usage:
return
res = requests.get("http://rockchin.top:18989/usage?service_name=qchatgpt.{}&version={}&count={}".format(subservice_name, self.version_str, count))
res = requests.get("http://reports.rockchin.top:18989/usage?service_name=qchatgpt.{}&version={}&count={}".format(subservice_name, self.version_str, count))
if res.status_code != 200 or res.text != "ok":
logging.warning("report to server failed, status_code: {}, text: {}".format(res.status_code, res.text))
except:
Expand Down
3 changes: 3 additions & 0 deletions pkg/utils/announcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

import requests

import pkg.utils.network as network


def read_latest() -> str:
resp = requests.get(
url="https://github.com/api/repos/RockChinQ/QChatGPT/contents/res/announcement",
proxies=network.wrapper_proxies()
)
obj_json = resp.json()
b64_content = obj_json["content"]
Expand Down
9 changes: 9 additions & 0 deletions pkg/utils/network.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

def wrapper_proxies() -> dict:
"""获取代理"""
import config

return {
"http": config.openai_config['proxy'],
"https": config.openai_config['proxy']
} if 'proxy' in config.openai_config and (config.openai_config['proxy'] is not None) else None
9 changes: 7 additions & 2 deletions pkg/utils/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json

import pkg.utils.constants
import pkg.utils.network as network


def check_dulwich_closure():
Expand Down Expand Up @@ -36,7 +37,8 @@ def pull_latest(repo_path: str) -> bool:
def get_release_list() -> list:
"""获取发行列表"""
rls_list_resp = requests.get(
url="https://github.com/api/repos/RockChinQ/QChatGPT/releases"
url="https://github.com/api/repos/RockChinQ/QChatGPT/releases",
proxies=network.wrapper_proxies()
)

rls_list = rls_list_resp.json()
Expand Down Expand Up @@ -83,7 +85,10 @@ def update_all(cli: bool = False) -> bool:
else:
print("开始下载最新版本: {}".format(latest_rls['zipball_url']))
zip_url = latest_rls['zipball_url']
zip_resp = requests.get(url=zip_url)
zip_resp = requests.get(
url=zip_url,
proxies=network.wrapper_proxies()
)
zip_data = zip_resp.content

# 检查temp/updater目录
Expand Down