AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/interruption/InterruptContext.java:107–170

InterruptContext的构建器。位于 io.agentscope.core.interruption 包。核心成员包括 source、timestamp、userMessage、pendingToolCalls、build。

Builder for InterruptContext.

方法摘要Method Summary

方法Method说明Description
public Builder source(InterruptSource source)
设置来源的中断。
Set the source of the interruption.
public Builder timestamp(Instant timestamp)
设置时间戳的中断。
Set the timestamp of the interruption.
public Builder userMessage(Msg userMessage)
设置用户消息。
Set the user message that triggered the interruption.
public Builder pendingToolCalls(List<ToolUseBlock> pendingToolCalls)
设置待处理工具调用 at 时间的中断。
Set the pending tool calls at the time of interruption.
public InterruptContext build()
构建InterruptContext。
Build the InterruptContext.

方法详情Method Detail

source

public Builder source(InterruptSource source)

设置来源的中断。

Set the source of the interruption.

参数Parameters
名称Name类型Type说明Description
sourceInterruptSource中断来源。The interrupt source
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/interruption/InterruptContext.java:121–124

timestamp

public Builder timestamp(Instant timestamp)

设置时间戳的中断。

Set the timestamp of the interruption.

参数Parameters
名称Name类型Type说明Description
timestampInstant中断时间戳。The interrupt timestamp
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/interruption/InterruptContext.java:132–135

userMessage

public Builder userMessage(Msg userMessage)

设置用户消息。

Set the user message that triggered the interruption.

参数Parameters
名称Name类型Type说明Description
userMessageMsg用户消息。The user message
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/interruption/InterruptContext.java:143–146

pendingToolCalls

public Builder pendingToolCalls(List<ToolUseBlock> pendingToolCalls)

设置待处理工具调用 at 时间的中断。

Set the pending tool calls at the time of interruption.

参数Parameters
名称Name类型Type说明Description
pendingToolCallsList<ToolUseBlock>待处理工具调用的列出。List of pending tool calls
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/core/interruption/InterruptContext.java:154–160

build

public InterruptContext build()

构建InterruptContext。

Build the InterruptContext.

返回Returns InterruptContext
一种新的InterruptContext 实例。A new InterruptContext instance
源码Source io/agentscope/core/interruption/InterruptContext.java:167–169
基于官方固定版本源码静态生成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.