Skip to content

Commit

Permalink
Added patch, and bot shows error when model is not downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeyoYT committed Aug 28, 2024
1 parent 73fafa3 commit 523e424
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/me/ailama/commands/AiCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public void handleCommand(SlashCommandInteractionEvent event) {

String userId = event.getUser().getId();

if(modelOption != null && !OllamaManager.getInstance().hasModel(modelOption)) {
event.getHook().sendMessage("The model you provided is invalid, please provide a valid model").setEphemeral(true).queue();
return;
}

if(resetSession) {
OllamaManager.getInstance().getChatMemory(userId).clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,7 @@ public AiServices<Assistant> createAssistantX(String modelName) {
public Assistant createAssistant(String modelName, String userID) {

Assistant assistant = getAssistantFromID(userID);
if(assistant != null && !isTooledAssistant) {

if(modelName != null && !modelName.equals(model)) {
return createAssistant(modelName, userID);
}

if(assistant != null && !isTooledAssistant && modelName != null) {
return assistant;
}

Expand Down

0 comments on commit 523e424

Please sign in to comment.