Class MessageEvent


  • public final class MessageEvent
    extends ConversationStreamEvent
    An incremental piece of the answer. This is the highest-frequency event; concatenate getText() fragments in arrival order.
    • Constructor Detail

      • MessageEvent

        public MessageEvent()
    • Method Detail

      • getText

        public String getText()
        Returns the incremental text fragment.
        Returns:
        incremental text fragment
      • getMessageType

        public String getMessageType()
        Returns the fragment kind: answer — final answer text; think — reasoning process; process — stage progress description.
        Returns:
        fragment kind
      • getKey

        public String getKey()
        Returns the identifier of the stream segment this fragment belongs to. Fragments with the same key form one continuous block — group by key when rendering.
        Returns:
        identifier of the stream segment this fragment belongs to
      • getStartedAt

        public long getStartedAt()
        Returns the time this segment started, Unix timestamp in seconds.
        Returns:
        time this segment started
      • getStage

        public String getStage()
        Returns the stage identifier; only present when getMessageType() is "process".
        Returns:
        stage identifier
      • getStageTitle

        public String getStageTitle()
        Returns the stage title while running; only present when getMessageType() is "process".
        Returns:
        stage title while running
      • getStageFinishedTitle

        public String getStageFinishedTitle()
        Returns the stage title after it finishes; only present when getMessageType() is "process".
        Returns:
        stage title after it finishes
      • getOutputs

        public String getOutputs()
        Returns the extra payload attached to the fragment, as JSON text; usually absent.
        Returns:
        extra payload attached to the fragment (JSON text), or null