类 TextBlock

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

public final class TextBlock extends ContentBlock
Represents plain text content in a message.

This is the most basic content block type, containing simple text content. Text blocks are commonly used for user messages, assistant responses, and any other textual communication.

The text content can be empty but never null. The toString() method returns the text content for convenience.

  • 方法详细资料

    • getText

      public String getText()
      Gets the text content of this block.
      返回:
      The text content
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • builder

      public static TextBlock.Builder builder()
      Creates a new builder for constructing TextBlock instances.
      返回:
      A new builder instance