周末愉快

+ 增加运行时自动清理ui缓存;
+ 增加gpt代理设置可为空;
+ 提高灵聚对接的稳定性。
This commit is contained in:
xszyou 2023-07-28 18:22:44 +08:00
parent c99ee0cc5a
commit f8ff5a2187
6 changed files with 28 additions and 12 deletions

View File

@ -37,7 +37,7 @@ Fay数字人助理版是fay开源项目的重要分支专注于构建智能
            ├── ASR   
         [FunASR](https://www.bilibili.com/video/BV1qs4y1g74e) ─┘   │     ┌─ Yuan 1.0
         [FunASR](https://www.bilibili.com/video/BV1qs4y1g74e) ─┘    │     ┌─ Yuan 1.0
               │     ├─ [LingJu](https://www.bilibili.com/video/BV1NW4y1D76a/)
@ -47,9 +47,9 @@ Fay数字人助理版是fay开源项目的重要分支专注于构建智能
         Azure ─┐    │     ├─ [VisualGLM](https://www.bilibili.com/video/BV1mP411Q7mj)
        Edge TTS ─┼── TTS    └─ [RWKV](https://www.bilibili.com/video/BV1yu41157zB)
        Edge TTS ─┼── TTS     └─ [RWKV](https://www.bilibili.com/video/BV1yu41157zB)
         [开源 TTS](https://www.bilibili.com/read/cv25192534) ─┘   │    
         [开源 TTS](https://www.bilibili.com/read/cv25192534) ─┘   │    
               │    
@ -120,6 +120,12 @@ Remote Android  [Live2D](https://www.bilibili.com/video/BV1sx4y1d775/?vd_sou
## **三、升级日志**
**2023.07.28**
+ 增加运行时自动清理ui缓存
+ 增加gpt代理设置可为空
+ 提高灵聚对接的稳定性。
**2023.07.26**
+ 修复连接数字人之前产生大量ws信息问题

View File

@ -46,11 +46,11 @@ ProTip:The shopping edition has been moved to a separate branch.[`fay-sales-edit
         Azure ─┐    │     ├─ [VisualGLM](https://www.bilibili.com/video/BV1mP411Q7mj)
        Edge TTS ─┼── TTS    └─ [RWKV](https://www.bilibili.com/video/BV1yu41157zB)
        Edge TTS ─┼── TTS     └─ [RWKV](https://www.bilibili.com/video/BV1yu41157zB)
    [Open source TTS](https://www.bilibili.com/read/cv25192534) ─┘  │    
  │    
               │    
               │    
@ -122,6 +122,12 @@ Message format: View [WebSocket.md](https://github.com/TheRamU/Fay/blob/main/Web
## **Upgrade Log**
**2023.07.28**
+ Add runtime automatic cleaning of UI cache;
+ Add GPT proxy setting can be null;
+ Improve the stability of Lingju docking.
**2023.07.21**
+ Fixed the problem of generating a large amount of WS information before connecting digital humans;

View File

@ -6,7 +6,10 @@ count = 0
def question(cont):
global count
try:
chatbot = Chatbot(model = "gpt-3.5", proxy = cfg.proxy_config, api_key = cfg.key_chatgpt_api_key)
if cfg.proxy_config != '' :
chatbot = Chatbot(proxy = cfg.proxy_config, api_key = cfg.key_chatgpt_api_key)
else:
chatbot = Chatbot(api_key = cfg.key_chatgpt_api_key)
response = chatbot.ask(cont)
count = 0
return response

View File

@ -44,7 +44,7 @@ class Lingju:
url="https://dev.lingju.ai/httpapi/ljchat.do"
req = json.dumps({"accessToken": token, "lat": lat, "lng": lng, "input": cont})
headers = {'Content-Type':'application/json;charset=UTF-8'}
r = requests.post(url, headers=headers, data=req)
r = requests.post(url, headers=headers, verify=False, data=req)
if r.status_code != 200:
util.log(1, f"灵聚api对接有误: {r.text}")
return "哎呀,出错了!请重新发一下"
@ -74,7 +74,7 @@ class Lingju:
cfg.load_config()
url=f"https://dev.lingju.ai/httpapi/authorize.do?appkey={cfg.key_lingju_api_key}&userid={self.userid}&authcode={cfg.key_lingju_api_authcode}"
headers = {'Content-Type':'application/json;charset=UTF-8'}
r = requests.post(url, headers=headers)
r = requests.post(url, headers=headers, verify=False)
if r.status_code != 200:
util.log(1, f"灵聚api对接有误: {r.text}")
return None

View File

@ -25,8 +25,8 @@ class MainWindow(QMainWindow):
# self.center()
self.browser = QWebEngineView()
#清空缓存
# profile = QWebEngineProfile.defaultProfile()
# profile.clearHttpCache()
profile = QWebEngineProfile.defaultProfile()
profile.clearHttpCache()
self.browser.load(QUrl('http://127.0.0.1:5000'))
self.setCentralWidget(self.browser)
MyThread(target=self.runnable).start()

View File

@ -20,7 +20,7 @@ ms_tts_region=
xf_ltp_app_id=
xf_ltp_api_key=
#NLP多选一:lingju、yuan、gpt、chatgpt、rasa(需启动chatglm及rasahttps://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM
#NLP多选一:lingju、yuan、gpt、chatgpt、rasa(需启动chatglm及rasahttps://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM、rwkv_api、rwkv
chat_module=lingju
#灵聚 服务密钥(NLP多选1) https://open.lingju.ai
@ -37,7 +37,8 @@ chatgpt_api_key=
#ChatGPT对接(NLP多选1)非必须https://chat.openai.com登录后访问https://chat.openai.com/api/auth/session获取
gpt_access_token=
gpt_conversation_id=
#gpt代理
#gpt代理(可为空填写例子http://127.0.0.1:7890)
proxy_config=http://127.0.0.1:7890
#ngrok内网穿透id远程设备可以通过互联网连接Fay非必须http://ngrok.cc