ashinnotfound / ChatGPT-YourChatRobot

❤开箱即用❤an unofficial implement of ChatGPT in QQ/Wechat. 一个非官方的ChatGPT腾讯qq/微信(非公众号)实现版,快来把你的qq或微信变成chatgpt吧
MIT License
432 stars 96 forks source link

请问为什么getApiKey()是null #57

Open pluto-han opened 1 year ago

pluto-han commented 1 year ago

终端提示:Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "com.ashin.config.ChatgptConfig.getApiKey()" is null 不知道为什么会这样,是因为key被封了吗 不知道该如何解决QAQ

ashinnotfound commented 1 year ago

应该是配置文件没写对,导致读取不到

pluto-han commented 1 year ago

这是我的配置文件,请问有什么地方需要改动吗

1514142997 @.***

 

------------------ 原始邮件 ------------------ 发件人: "ashinnotfound/ChatGPT-YourChatRobot" @.>; 发送时间: 2023年4月26日(星期三) 下午3:56 @.>; @.**@.>; 主题: Re: [ashinnotfound/ChatGPT-YourChatRobot] 请问为什么getApiKey()是null (Issue #57)

应该是配置文件没写对,导致读取不到

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ashinnotfound commented 1 year ago

你确定发送完整了吗,我并没有看到(记得将关键信息打码) image

ashinnotfound commented 1 year ago

方便截图吗 刚刚你cv过来的有些转义 (记得apikey也打码,我把刚才你的回复删了,防止你的apikey泄露)

pluto-han commented 1 year ago

application 感谢。下面是截图(不知道能否正常显示)

ashinnotfound commented 1 year ago

你是在什么环境下运行的呢

pluto-han commented 1 year ago

jdk17.0.7

1514142997 @.***

 

------------------ 原始邮件 ------------------ 发件人: "ashinnotfound/ChatGPT-YourChatRobot" @.>; 发送时间: 2023年4月26日(星期三) 下午4:59 @.>; @.**@.>; 主题: Re: [ashinnotfound/ChatGPT-YourChatRobot] 请问为什么getApiKey()是null (Issue #57)

你是在什么环境下运行的呢

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ashinnotfound commented 1 year ago

jar包运行还是ide里

pluto-han commented 1 year ago

在shell终端使用java -jar命令运行 

1514142997 @.***

 

------------------ 原始邮件 ------------------ 发件人: "xun @.>; 发送时间: 2023年4月26日(星期三) 下午5:02 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ashinnotfound/ChatGPT-YourChatRobot] 请问为什么getApiKey()是null (Issue #57)

jar包运行还是ide里

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ashinnotfound commented 1 year ago

貌似你的配置没问题,更像是jar包没有读取到application.yml文件

ashinnotfound commented 1 year ago

你的配置文件名是application.yml吗,我看你截图似乎没有后缀.yml

pluto-han commented 1 year ago

是yml后缀,我没有设置'显示拓展名'。我怀疑就是我的api有问题,我给其他gpt项目使用我的key,也出现了问题  

1514142997 @.***

 

------------------ 原始邮件 ------------------ 发件人: "xun @.>; 发送时间: 2023年4月26日(星期三) 下午5:15 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ashinnotfound/ChatGPT-YourChatRobot] 请问为什么getApiKey()是null (Issue #57)

你的配置文件名是application.yml吗,我看你截图似乎没有后缀.yml

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ashinnotfound commented 1 year ago

是yml后缀,我没有设置'显示拓展名'。我怀疑就是我的api有问题,我给其他gpt项目使用我的key,也出现了问题   1514142997 @.   ------------------ 原始邮件 ------------------ 发件人: "xun @.>; 发送时间: 2023年4月26日(星期三) 下午5:15 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ashinnotfound/ChatGPT-YourChatRobot] 请问为什么getApiKey()是null (Issue #57) 你的配置文件名是application.yml吗,我看你截图似乎没有后缀.yml — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

jar包和application.yml在同级目录下吗,我刚才尝试把它删除后缀.yml或者把application.yml放于不同级目录,出现了和你一样的报错。应该不是api的问题,因为它就没读取到apikey,而且如果是apikey的问题,报错也不会是这个

pluto-han commented 1 year ago

Snipaste_2023-04-26_17-47-21 我的是这样子的,需要做什么更改吗

ashinnotfound commented 1 year ago

Snipaste_2023-04-26_17-47-21 我的是这样子的,需要做什么更改吗

这我也不知道为什么了😐