ae1d2ae292
+ 修复多个bug:消息框换行及空格问题、语音识别优化; + 彩蛋转正,Fay沟通与ChatGPT并行; + 加入yolov8姿态识别; + 加入VisualGLM-6B多模态单机离线大语言模型。
31 lines
861 B
Python
31 lines
861 B
Python
from revChatGPT.V1 import Chatbot
|
||
from core.content_db import Content_Db
|
||
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,
|
||
"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
|