AS AgentScopeAPI 手册 / API Reference

ThinkingAccumulator

public class ThinkingAccumulator implements ContentAccumulator<ThinkingBlock>
源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:36–121

Thinking Accumulator,驱动智能体的推理、工具调用与会话执行。位于 io.agentscope.core.agent.accumulator 包,实现 ContentAccumulator<ThinkingBlock>。核心成员包括 add、hasContent、buildAggregated、reset、getAccumulated。

Thinking content accumulator for accumulating streaming thinking chunks.

This accumulator concatenates all thinking chunks in order to build the complete thinking content.

List-valued metadata (e.g. reasoning details) is accumulated in stream order: entries from each chunk are appended rather than replaced. Scalar metadata uses last-write-wins. List values are always copied to prevent caller mutation from affecting accumulator state.

方法摘要Method Summary

方法Method说明Description
public void add(ThinkingBlock block)
设置添加。
Performs the add operation.
public boolean hasContent()
判断是否具有内容。
Returns whether this has the content.
public ContentBlock buildAggregated()
构建 `buildAggregated`。
Builds the aggregated.
public void reset()
清空或重置内部状态。
Clears or resets internal state.
public String getAccumulated()
获取 `getAccumulated`。
Get the accumulated thinking content.

方法详情Method Detail

add

public void add(ThinkingBlock block)

设置添加。

Performs the add operation.

参数Parameters
名称Name类型Type说明Description
blockThinkingBlock内容块(类型 `ThinkingBlock`)。The block.
源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:44–52

hasContent

public boolean hasContent()

判断是否具有内容。

Returns whether this has the content.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:57–60

buildAggregated

public ContentBlock buildAggregated()

构建 buildAggregated。

Builds the aggregated.

返回Returns ContentBlock
返回ContentBlock。Returns content block.
源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:65–75

reset

public void reset()

清空或重置内部状态。

Clears or resets internal state.

源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:80–84

getAccumulated

public String getAccumulated()

获取 getAccumulated。

Get the accumulated thinking content.

返回Returns String
返回字符串结果。accumulated thinking as string
源码Source io/agentscope/core/agent/accumulator/ThinkingAccumulator.java:118–120
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.