Package com.longbridge.agent
Class MessageEvent
- java.lang.Object
-
- com.longbridge.agent.ConversationStreamEvent
-
- com.longbridge.agent.MessageEvent
-
public final class MessageEvent extends ConversationStreamEvent
An incremental piece of the answer. This is the highest-frequency event; concatenategetText()fragments in arrival order.
-
-
Constructor Summary
Constructors Constructor Description MessageEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetKey()Returns the identifier of the stream segment this fragment belongs to.StringgetMessageType()Returns the fragment kind:answer— final answer text;think— reasoning process;process— stage progress description.StringgetOutputs()Returns the extra payload attached to the fragment, as JSON text; usually absent.StringgetStage()Returns the stage identifier; only present whengetMessageType()is"process".StringgetStageFinishedTitle()Returns the stage title after it finishes; only present whengetMessageType()is"process".StringgetStageTitle()Returns the stage title while running; only present whengetMessageType()is"process".longgetStartedAt()Returns the time this segment started, Unix timestamp in seconds.StringgetText()Returns the incremental text fragment.StringtoString()
-
-
-
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 whengetMessageType()is"process".- Returns:
- stage identifier
-
getStageTitle
public String getStageTitle()
Returns the stage title while running; only present whengetMessageType()is"process".- Returns:
- stage title while running
-
getStageFinishedTitle
public String getStageFinishedTitle()
Returns the stage title after it finishes; only present whengetMessageType()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
-
-