类 InterruptContext
java.lang.Object
io.agentscope.core.interruption.InterruptContext
Context information about an interruption.
Captures metadata about when and why an interruption occurred, including the source, timestamp, user message (if any), and any pending tool calls that were interrupted.
Example usage:
InterruptContext context = InterruptContext.builder()
.source(InterruptSource.USER)
.userMessage(userMsg)
.pendingToolCalls(toolCalls)
.build();
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static InterruptContext.Builderbuilder()Create a new builder for InterruptContext.Get the list of tool calls that were pending when the interruption occurred.Get the source of the interruption.Get the timestamp when the interruption occurred.Get the user message that triggered the interruption (if any).toString()Returns a string representation of the interrupt context.
-
方法详细资料
-
getSource
Get the source of the interruption.- 返回:
- The interrupt source
-
getTimestamp
Get the timestamp when the interruption occurred.- 返回:
- The interrupt timestamp
-
getUserMessage
Get the user message that triggered the interruption (if any).- 返回:
- The user message, or null if not applicable
-
getPendingToolCalls
Get the list of tool calls that were pending when the interruption occurred.- 返回:
- Immutable list of pending tool calls
-
builder
Create a new builder for InterruptContext.- 返回:
- A new builder instance
-
toString
Returns a string representation of the interrupt context.The string includes the interrupt source, timestamp, user message presence, and count of pending tool calls in a compact format.
-