rebane2001 / aimobs

Chat with Minecraft mobs and entities by using the OpenAI API
GNU Lesser General Public License v3.0
32 stars 13 forks source link

Add better error handling (Error getting response) #2

Open OnTheLink opened 1 year ago

OnTheLink commented 1 year ago

Just trying to get it to work, already set the API key and tried a few models as documenten on openai. When I shift-click a mob I am getting the chat message [AIMobs] Error getting response as seen in the title.

Here is the output of the log:

[00:30:45] [Thread-109/INFO]: Prompt: You meet a talking hurt Skeleton in the Plains. The Skeleton says to you: "
[00:30:45] [Thread-109/INFO]: [CHAT] [AIMobs] Error getting response
[00:30:45] [Thread-109/INFO]: [STDERR]: java.lang.NullPointerException: Cannot load from object array because "com.google.gson.Gson.fromJson(String, java.lang.Class).choices" is null
[00:30:45] [Thread-109/INFO]: [STDERR]:     at com.rebane2001.aimobs.RequestHandler.getAIResponse(RequestHandler.java:56)
[00:30:45] [Thread-109/INFO]: [STDERR]:     at com.rebane2001.aimobs.ActionHandler.lambda$getResponse$0(ActionHandler.java:76)
[00:30:45] [Thread-109/INFO]: [STDERR]:     at java.base/java.lang.Thread.run(Thread.java:833)
rebane2001 commented 1 year ago

I need to add better error-handling to actually show the error message in the mod. In the meanwhile, are you sure your OpenAI account can use GPT (try on the playground, NOT ChatGPT)?

OnTheLink commented 1 year ago

Thank you, it was indeed a misconfiguration on my part. What would you suggest would be the best model to use for the mobs?

cagkannorris commented 9 months ago

I need to add better error-handling to actually show the error message in the mod. In the meanwhile, are you sure your OpenAI account can use GPT (try on the playground, NOT ChatGPT)?

Hey, how can i check this? I've been trying to figure out a way to overcome this error but failing lol :( sorry

Timman6866 commented 5 months ago

Thank you, it was indeed a misconfiguration on my part. What would you suggest would be the best model to use for the mobs?

Greetings! Would you mind sharing the configuration that was fixed? I'm running into the same error message and my API Key shows 0 usage.

Best,

EDIT: It turns out my OpenAI account wasn't a paying account. It seemed like I had $5 of credit available but that was not the case. Once I corrected the billing issue the mod is now working great. Thanks!