java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.service.chat.MemoryService
All Implemented Interfaces:
fr.paris.lutece.portal.service.init.ShutdownService, fr.paris.lutece.portal.service.util.LuteceService

@ApplicationScoped public class MemoryService extends Object implements fr.paris.lutece.portal.service.init.ShutdownService
  • Constructor Details

    • MemoryService

      public MemoryService()
  • Method Details

    • init

      @PostConstruct public void init()
      Initializes the memory service after CDI construction.
    • createConversation

      public String createConversation(fr.paris.lutece.portal.service.security.LuteceUser user)
      Creates a new conversation for the specified user
      Parameters:
      user - The user for whom to create the conversation
      Returns:
      The generated conversation ID
    • getChatMemory

      public dev.langchain4j.memory.ChatMemory getChatMemory(String conversationId, fr.paris.lutece.portal.service.security.LuteceUser user)
      Retrieves the chat memory for a conversation with ownership validation
      Parameters:
      conversationId - The ID of the conversation
      user - The user requesting access to the conversation
      Returns:
      The ChatMemory instance for the conversation
    • deleteConversation

      public void deleteConversation(String conversationId)
      Deletes a conversation and its associated messages
      Parameters:
      conversationId - The ID of the conversation to delete
    • getName

      public String getName()
      Specified by:
      getName in interface fr.paris.lutece.portal.service.util.LuteceService
    • process

      public void process()
      Specified by:
      process in interface fr.paris.lutece.portal.service.init.ShutdownService