Interface ConversationFactory

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • create

         abstract Conversation create(String id)

        Create a new conversation with the given ID.

        Parameters:
        id - unique identifier for the conversation
        Returns:

        a new Conversation instance

      • load

         Conversation load(String id)

        Load an existing conversation from storage.

        For persistent implementations, this restores a conversation with its message history from the backing store. For in-memory implementations, this returns null (nothing to restore).

        Parameters:
        id - the conversation ID to load
        Returns:

        the conversation if found, null otherwise

      • createForParticipants

         Conversation createForParticipants(String id, User user, User agent, String title)

        Create a conversation for a 1-1 chat between a user and an agent.

        Messages can be automatically attributed based on role when participants are set.

        Parameters:
        id - the conversation/session ID
        user - the human user participant
        agent - the AI/system user participant (optional)
        title - the session title (optional)
        Returns:

        a new Conversation instance