类 ThinkingBlock

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

public final class ThinkingBlock extends ContentBlock
Represents reasoning or thinking content in a message.

This content block is used to capture the internal reasoning process of an agent before taking action. It provides transparency into how the agent arrived at its decisions or tool choices.

Thinking blocks are particularly useful in ReAct agents and other reasoning-intensive systems where understanding the agent's thought process is valuable for debugging and analysis.

The optional metadata field can store additional reasoning information such as OpenRouter's reasoning_details (reasoning.text, reasoning.encrypted, reasoning.summary) that need to be preserved and restored when formatting messages back to the API.

  • 字段详细资料

    • METADATA_REASONING_DETAILS

      public static final String METADATA_REASONING_DETAILS
      Metadata key for storing OpenRouter/Gemini reasoning details list.
      另请参阅:
  • 方法详细资料

    • getThinking

      public String getThinking()
      Gets the thinking/reasoning content of this block.
      返回:
      The thinking content
    • getMetadata

      public Map<String,Object> getMetadata()
      Gets the metadata associated with this thinking block.

      Metadata can contain additional reasoning information such as:

      返回:
      The metadata map, or null if no metadata is set
    • builder

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