AS AgentScopeAPI 手册 / API Reference

PreviewIds

public static final class PreviewIds
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:297–413

预览 Ids,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed 包。核心成员包括 messageEventId、consumeMessageEventId、thinkingEventId、toolUseEventId、beginToolUse、appendToolInput。

Allocates stable preview / persist event ids for a turn and accumulates tool buffers.

方法摘要Method Summary

方法Method说明Description
public String messageEventId()
返回消息事件标识。
Returns the message event id.
public String consumeMessageEventId()
返回消费消息事件标识。
Returns and clears the in-flight message preview id (null when no deltas streamed).
public String thinkingEventId()
返回 `thinkingEventId` 结果。
Returns the thinking event id.
public String toolUseEventId(String toolCallId)
设置工具使用事件标识。
Performs the tool use event id operation.
public ToolBuffers.ToolUseBuffer beginToolUse(String toolCallId, String toolName)
执行 `beginToolUse` 方法。
Performs the begin tool use operation.
public void appendToolInput(String toolCallId, String toolName, String delta)
追加工具输入。
Performs the append tool input operation.
public ToolBuffers.ToolUseBuffer finishToolUse(String toolCallId, String toolName)
执行 `finishToolUse` 方法。
Performs the finish tool use operation.
public void appendToolResultText(String toolCallId, String toolName, String delta)
追加工具结果文本。
Performs the append tool result text operation.
public ToolBuffers.ToolResultBuffer finishToolResult(String toolCallId, String toolName)
执行 `finishToolResult` 方法。
Performs the finish tool result operation.
public void resetMessage()
重置消息。
Resets the message.
public void resetThinking()
重置 `resetThinking`。
Resets the thinking.
public void appendThinking(String delta)
追加 `appendThinking`。
Performs the append thinking operation.
public Optional<PersistedEvent> consumeThinking()
返回 `consumeThinking` 结果。
Returns the consume thinking.

方法详情Method Detail

messageEventId

public String messageEventId()

返回消息事件标识。

Returns the message event id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:305–310

consumeMessageEventId

public String consumeMessageEventId()

返回消费消息事件标识。

Returns and clears the in-flight message preview id (null when no deltas streamed).

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:313–317

thinkingEventId

public String thinkingEventId()

返回 thinkingEventId 结果。

Returns the thinking event id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:319–324

toolUseEventId

public String toolUseEventId(String toolCallId)

设置工具使用事件标识。

Performs the tool use event id operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:326–328

beginToolUse

public ToolBuffers.ToolUseBuffer beginToolUse(String toolCallId, String toolName)

执行 beginToolUse 方法。

Performs the begin tool use operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
toolNameString工具名称(类型 `String`)。The tool name.
返回Returns ToolBuffers.ToolUseBuffer
返回ToolBuffers.ToolUseBuffer。Returns tool buffers tool use buffer.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:330–334

appendToolInput

public void appendToolInput(String toolCallId, String toolName, String delta)

追加工具输入。

Performs the append tool input operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
toolNameString工具名称(类型 `String`)。The tool name.
deltaString增量(类型 `String`)。The delta.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:336–342

finishToolUse

public ToolBuffers.ToolUseBuffer finishToolUse(String toolCallId, String toolName)

执行 finishToolUse 方法。

Performs the finish tool use operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
toolNameString工具名称(类型 `String`)。The tool name.
返回Returns ToolBuffers.ToolUseBuffer
返回ToolBuffers.ToolUseBuffer。Returns tool buffers tool use buffer.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:344–351

appendToolResultText

public void appendToolResultText(String toolCallId, String toolName, String delta)

追加工具结果文本。

Performs the append tool result text operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
toolNameString工具名称(类型 `String`)。The tool name.
deltaString增量(类型 `String`)。The delta.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:353–362

finishToolResult

public ToolBuffers.ToolResultBuffer finishToolResult(String toolCallId, String toolName)

执行 finishToolResult 方法。

Performs the finish tool result operation.

参数Parameters
名称Name类型Type说明Description
toolCallIdString工具调用标识(类型 `String`)。The tool call id.
toolNameString工具名称(类型 `String`)。The tool name.
返回Returns ToolBuffers.ToolResultBuffer
返回ToolBuffers.ToolResultBuffer。Returns tool buffers tool result buffer.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:364–374

resetMessage

public void resetMessage()

重置消息。

Resets the message.

源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:376–378

resetThinking

public void resetThinking()

重置 resetThinking。

Resets the thinking.

源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:380–384

appendThinking

public void appendThinking(String delta)

追加 appendThinking。

Performs the append thinking operation.

参数Parameters
名称Name类型Type说明Description
deltaString增量(类型 `String`)。The delta.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:386–390

consumeThinking

public Optional<PersistedEvent> consumeThinking()

返回 consumeThinking 结果。

Returns the consume thinking.

返回Returns Optional<PersistedEvent>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/managed/SessionEventMapper.java:392–404
基于官方固定版本源码静态生成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.