AS AgentScopeAPI 手册 / API Reference
类class agentscope.tool

ToolChunk

class ToolChunk(BaseModel)
源码Source agentscope/tool/_response.py:28–48

工具结果分块来自工具执行。位于 agentscope.tool 包。

The tool result chunk from a tool execution. Declared in agentscope.tool.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
contentList[TextBlock | DataBlock]
内容字段。
—
stateToolResultState
状态字段。
ToolResultState.RUNNING
is_lastbool
是最后字段。
True
metadatadict
元数据字段。
Field(default_factory=dict)
idstr
标识字段。
Field(default_factory=_generate_id)

属性详情Attribute Detail

content

List[TextBlock | DataBlock]

内容字段。声明为 List[TextBlock | DataBlock]。

The content field.

源码Source agentscope/tool/_response.py:31

state

ToolResultState = ToolResultState.RUNNING

状态字段。声明为 ToolResultState。

The state field.

源码Source agentscope/tool/_response.py:36

is_last

bool = True

是最后字段。声明为 bool。

The is last field.

源码Source agentscope/tool/_response.py:39

metadata

dict = Field(default_factory=dict)

元数据字段。声明为 dict。

The metadata field.

源码Source agentscope/tool/_response.py:42

id

str = Field(default_factory=_generate_id)

标识字段。声明为 str。

The id field.

源码Source agentscope/tool/_response.py:47
基于官方固定版本源码静态生成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.