diff --git a/src/main/java/com/devoxx/genie/controller/ProjectContextController.java b/src/main/java/com/devoxx/genie/controller/ProjectContextController.java index db437c7..5d16730 100644 --- a/src/main/java/com/devoxx/genie/controller/ProjectContextController.java +++ b/src/main/java/com/devoxx/genie/controller/ProjectContextController.java @@ -104,7 +104,10 @@ private boolean isSupportedProvider(@NotNull ModelProvider modelProvider) { modelProvider.equals(DeepSeek) || modelProvider.equals(OpenRouter) || modelProvider.equals(DeepInfra) || - modelProvider.equals(Ollama); + modelProvider.equals(Ollama) || + modelProvider.equals(Jan) || + modelProvider.equals(LMStudio); + // Note : NOT GPT4All because the selected context window is not provided in JSON model response } private int getWindowContext() { diff --git a/src/main/java/com/devoxx/genie/service/ChatMemoryService.java b/src/main/java/com/devoxx/genie/service/ChatMemoryService.java index 5d11ec2..1b86fb3 100644 --- a/src/main/java/com/devoxx/genie/service/ChatMemoryService.java +++ b/src/main/java/com/devoxx/genie/service/ChatMemoryService.java @@ -101,7 +101,7 @@ public void restoreConversation(@NotNull Project project, @NotNull Conversation clear(project); for (com.devoxx.genie.model.conversation.ChatMessage message : conversation.getMessages()) { if (message.isUser()) { - add(project, UserMessage.from(new TextContent(message.getContent()))); + add(project, UserMessage.from(message.getContent())); } else { add(project, AiMessage.from(message.getContent())); } diff --git a/src/main/java/com/devoxx/genie/service/MessageCreationService.java b/src/main/java/com/devoxx/genie/service/MessageCreationService.java index 570e9c9..1adbd45 100644 --- a/src/main/java/com/devoxx/genie/service/MessageCreationService.java +++ b/src/main/java/com/devoxx/genie/service/MessageCreationService.java @@ -105,7 +105,7 @@ private void constructUserMessageWithCombinedContext(@NotNull ChatMessageContext stringBuilder.append(editorContent); } - chatMessageContext.setUserMessage(UserMessage.from(new TextContent(stringBuilder.toString()))); + chatMessageContext.setUserMessage(UserMessage.from(stringBuilder.toString())); } /** @@ -244,7 +244,7 @@ private void constructUserMessageWithFullContext(@NotNull ChatMessageContext cha stringBuilder.append(chatMessageContext.getUserPrompt()); stringBuilder.append(""); - chatMessageContext.setUserMessage(UserMessage.from(new TextContent(stringBuilder.toString()))); + chatMessageContext.setUserMessage(UserMessage.from(stringBuilder.toString())); } /** diff --git a/src/main/java/com/devoxx/genie/service/PromptExecutionService.java b/src/main/java/com/devoxx/genie/service/PromptExecutionService.java index af43136..4a85ca1 100644 --- a/src/main/java/com/devoxx/genie/service/PromptExecutionService.java +++ b/src/main/java/com/devoxx/genie/service/PromptExecutionService.java @@ -66,8 +66,7 @@ static PromptExecutionService getInstance() { // Add User message to context MessageCreationService.getInstance().addUserMessageToContext(chatMessageContext); - - // chatMemoryService.add(chatMessageContext.getProject(), chatMessageContext.getUserMessage()); + chatMemoryService.add(chatMessageContext.getProject(), chatMessageContext.getUserMessage()); long startTime = System.currentTimeMillis(); @@ -114,17 +113,11 @@ private boolean isCanceled() { private @NotNull Response processChatMessage(ChatMessageContext chatMessageContext) { try { ChatLanguageModel chatLanguageModel = chatMessageContext.getChatLanguageModel(); - - ChatMemoryService chatMemoryService = ChatMemoryService.getInstance(); - List messages = chatMemoryService.messages(chatMessageContext.getProject()); - + List messages = ChatMemoryService.getInstance().messages(chatMessageContext.getProject()); Response response = chatLanguageModel.generate(messages); - - chatMemoryService.add(chatMessageContext.getProject(), response.content()); - + ChatMemoryService.getInstance().add(chatMessageContext.getProject(), response.content()); return response; } catch (Exception e) { - LOG.error("Error occurred while processing chat message", e); if (chatMessageContext.getLanguageModel().getProvider().equals(ModelProvider.Jan)) { throw new ModelNotActiveException("Selected Jan model is not active. Download and make it active or add API Key in Jan settings."); } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 3d488ee..60f2eda 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -43,6 +43,7 @@
  • Feat #400 : List "custom local model" when enabled in dropdown
  • Feat #400 : Removed Exo & JLama because they can use the Custom OpenAI-compliant local provider
  • Fix #399 : Fixed UserMessage GPT4ALL issue
  • +
  • Feat #402 : Allow all LLM Providers to have the "Add Project" feature
  • V0.4.5

      diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 51bb123..0b3e0d5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,2 @@ -#Tue Dec 17 13:03:41 CET 2024 +#Tue Dec 17 19:51:55 CET 2024 version=0.4.6