xszyou / Fay

Fay is an open-source digital human framework integrating language models and digital characters. It offers retail, assistant, and agent versions for diverse applications like virtual shopping guides, broadcasters, assistants, waiters, teachers, and voice or text-based mobile assistants.
GNU General Public License v3.0
8.85k stars 1.75k forks source link

无法调用chatgpt key #54

Open nijisakai opened 1 year ago

nijisakai commented 1 year ago

Error:

20:22:36][系统] 自然语言处理...
can only concatenate str (not "TypeError") to str
[20:23:06][系统] 自然语言处理错误!

已确认网络可正常访问chatgpt,且api有效。 环境:Windows11, Anaconda

system.conf:

[key]
#funasr / ali
ASR_mode = ali
#ASR_mode = funasr
#ASR二选一(需要运行fay/test/funasr服务)集成达摩院asr项目、感谢中科大脑算法工程师张聪聪提供集成代码
local_asr_ip=127.0.0.1
local_asr_port=10197

# ASR二选一(第1次运行建议用这个,免费3个月), 阿里云 实时语音识别 服务密钥(必须)https://ai.aliyun.com/nls/trans
ali_nls_key_id=LTAId2LA
ali_nls_key_secret=CDCNGcCczbX8ZYF
ali_nls_app_key=3CkjbsF54

# 微软 文字转语音 服务密钥(非必须,使用可产生不同情绪的音频)https://azure.microsoft.com/zh-cn/services/cognitive-services/text-to-speech/
ms_tts_key=
ms_tts_region=

# 讯飞 情绪分析 服务密钥 https://www.xfyun.cn/service/emotion-analysis/
xf_ltp_app_id=91688
xf_ltp_api_key=697216706abdd1bed

#NLP五选一:lingju、yuan、chatgpt、rasa(需启动chatglm及rasa,https://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM
#chat_module=lingju
chat_module=chatgpt
#灵聚 服务密钥(NLP多选1) https://open.lingju.ai
lingju_api_key=7b2fe0f1a2
lingju_api_authcode=b7900f

#浪.潮源大模型 服务密钥(NLP5多1) https://air.inspur.com/
yuan_1_0_account=  
yuan_1_0_phone=

#gpt 服务密钥(NLP多选1) https://openai.com/
chatgpt_api_key=sk-1gwGRWawx

#ngrok内网穿透id,远程设备可以通过互联网连接Fay(非必须)http://ngrok.cc
ngrok_cc_id=

#revChatGPT对接(非必须,https://chat.openai.com登录后访问https://chat.openai.com/api/auth/session获取)

gpt_access_token=
gpt_conversation_id=

proxy_config=
xzl1996 commented 1 year ago

哥们,有解决吗,我也碰到了同样的问题

nijisakai commented 1 year ago

哥们,有解决吗,我也碰到了同样的问题

#NLP五选一:lingju、yuan、chatgpt、rasa(需启动chatglm及rasa,https://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM
#chat_module=lingju
chat_module=gpt

chatgpt->gpt

xzl1996 commented 1 year ago

哥们,有解决吗,我也碰到了同样的问题

#NLP五选一:lingju、yuan、chatgpt、rasa(需启动chatglm及rasa,https://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM
#chat_module=lingju
chat_module=gpt

chatgpt->gpt

解决了,感谢!!

gogo03 commented 1 year ago

我的版本不是这么解决的。 是作者源代码有一个bug: nlp_gpt.py要改一下。 第9行:model--->engine chatbot = Chatbot(engine = "gpt-3.5-turbo-0613", proxy = cfg.proxy_config, api_key = cfg.key_chatgpt_api_key)