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.
1、上传chatgpt彩蛋; 2、修复音频合成过长不播放问题。
- Loading branch information
Showing
8 changed files
with
100 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from revChatGPT.V1 import Chatbot | ||
from core.content_db import Content_Db | ||
from utils import config_util as cfg | ||
|
||
def question(cont): | ||
contentdb = Content_Db() | ||
list = contentdb.get_list('all','desc',5) | ||
text = '' | ||
if len(list) > 0: | ||
relist = [] | ||
i = len(list)-1 | ||
text = '以下是我和机器人的历史对话:' | ||
while i >= 0: | ||
if list[i][0] == 'fay': | ||
text = text + ' 机器人:' + list[i][2] | ||
else: | ||
text = text + ' 我:' + list[i][2] | ||
i -= 1 | ||
|
||
try: | ||
chatbot = Chatbot(config={ | ||
"access_token": cfg.key_gpt_access_token, | ||
"conversation_id": cfg.key_gpt_conversation_id | ||
}) | ||
|
||
prompt = text + ' 现在想咨询的问题是:'+cont | ||
response = "" | ||
for data in chatbot.ask( | ||
prompt | ||
): | ||
response = data["message"] | ||
return response | ||
except: | ||
return 'gpt当前繁忙,请稍后重试' |
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
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 |
---|---|---|
|
@@ -18,4 +18,5 @@ simhash | |
pytz | ||
gevent~=22.10.1 | ||
edge_tts~=6.1.3 | ||
eyed3 | ||
eyed3 | ||
#revChatGPT 删除注释打开彩蛋 |
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