类 UserMessage

java.lang.Object
io.agentscope.core.message.Msg
io.agentscope.core.message.UserMessage
所有已实现的接口:
State

public final class UserMessage extends Msg
A Msg with MsgRole.USER pinned at construction time.

Provides convenience constructors that take a String directly (wrapped into a TextBlock) or any combination of ContentBlocks, removing the boilerplate of Msg.builder().role(USER).content(...).build().

Also offers an independent UserMessage.Builder for cases that need to set metadata, timestamp, usage or generateReason.

Allowed content blocks follow the rules enforced by Msg's constructor: text, image, audio, video, and data blocks.

  • 构造器详细资料

  • 方法详细资料

    • builder

      public static UserMessage.Builder builder()
      Creates a builder for UserMessage with a randomly generated ID and the current timestamp pre-populated.