forked from xszyou/Fay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ 重构NLP模块管理逻辑,便于自由扩展; + gpt:拆分为ChatGPT及GPT、更换新的GPT接口、可单独配置代理服务器; + 指定yolov8包版本,解决yolo不兼容问题; + 修复:自言自语bug、接收多个待处理消息bug。
- Loading branch information
Showing
10 changed files
with
117 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from revChatGPT.V1 import Chatbot | ||
from utils import config_util as cfg | ||
import time | ||
|
||
count = 0 | ||
def question(cont): | ||
global count | ||
try: | ||
chatbot = Chatbot(config={ | ||
"access_token": cfg.key_gpt_access_token, | ||
"paid": False, | ||
"collect_analytics": True, | ||
"proxy": cfg.proxy_config, | ||
"model": "gpt-4", | ||
"conversation_id":cfg.key_gpt_conversation_id | ||
},conversation_id=cfg.key_gpt_conversation_id, | ||
parent_id=None) | ||
|
||
prompt = cont | ||
response = "" | ||
for data in chatbot.ask(prompt): | ||
response = data["message"] | ||
count = 0 | ||
return response | ||
except Exception as e: | ||
count += 1 | ||
if count < 3: | ||
time.sleep(15) | ||
return question(cont) | ||
return 'gpt当前繁忙,请稍后重试' + e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
requests~=2.26.0 | ||
numpy~=1.22.0 | ||
numpy | ||
pyaudio~=0.2.11 | ||
websockets~=10.2 | ||
ws4py~=0.5.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters