Builder
public static class Builder
源码Source
io/agentscope/core/interruption/InterruptContext.java:107–170InterruptContext的构建器。位于 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 |
|---|---|---|
source | InterruptSource | 中断来源。The interrupt source |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/interruption/InterruptContext.java:121–124timestamp
public Builder timestamp(Instant timestamp)
设置时间戳的中断。
Set the timestamp of the interruption.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timestamp | Instant | 中断时间戳。The interrupt timestamp |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/interruption/InterruptContext.java:132–135userMessage
public Builder userMessage(Msg userMessage)
设置用户消息。
Set the user message that triggered the interruption.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userMessage | Msg | 用户消息。The user message |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/interruption/InterruptContext.java:143–146pendingToolCalls
public Builder pendingToolCalls(List<ToolUseBlock> pendingToolCalls)
设置待处理工具调用 at 时间的中断。
Set the pending tool calls at the time of interruption.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
pendingToolCalls | List<ToolUseBlock> | 待处理工具调用的列出。List of pending tool calls |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/interruption/InterruptContext.java:154–160build
public InterruptContext build()
构建InterruptContext。
Build the InterruptContext.
InterruptContext一种新的InterruptContext 实例。A new InterruptContext instance
源码Source
io/agentscope/core/interruption/InterruptContext.java:167–169