Interface Conversation

  • All Implemented Interfaces:
    com.embabel.chat.AssetView , com.embabel.common.core.Identified , com.embabel.common.core.StableIdentified , com.embabel.common.core.types.HasInfoString

    
    public interface Conversation
     implements StableIdentified, HasInfoString, AssetView
                        

    Conversation shim for agent system. Mutable. Conversation AssetView shows assets both from our AssetTracker and messages.

    • 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

      • addMessage

         abstract Message addMessage(Message message)

        Modify the state of this conversation. Return the newly added message for convenience.

      • addMessageFrom

         Message addMessageFrom(Message message, User author)

        Add a message with explicit author attribution. Useful for group chats or when the author differs per message.

        Parameters:
        message - the message to add
        author - the author of this message (null for system/assistant messages)
        Returns:

        the newly added message

      • addMessageFromTo

         Message addMessageFromTo(Message message, User from, User to)

        Add a message with explicit author and recipient. Use this for multi-party chats where both sender and receiver need to be specified.

        Parameters:
        message - the message to add
        from - the author of this message (who sent it)
        to - the recipient of this message (who should receive it)
        Returns:

        the newly added message

      • promptContributor

         PromptContributor promptContributor(ConversationFormatter conversationFormatter)

        Prompt contributor that represents the conversation so far. Usually we will want to add messages from the conversation to a prompt instead of formatting the conversation

      • last

         abstract Conversation last(Integer n)

        Create a nonpersistent conversation with the last n messages from this conversation.

      • getMessages

         abstract List<Message> getMessages()

        Messages in the conversation in chronological order. Visible to user.