Skip to content

Add better error handling (Error getting response) #2

@MishaOpstal

Description

@MishaOpstal

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions