SummaryEvent
@Deprecated(forRemoval = true, since = "2.0.0") public abstract sealed class SummaryEvent extends HookEvent permits PreSummaryEvent, SummaryChunkEvent, PostSummaryEvent
源码Source
io/agentscope/core/hook/SummaryEvent.java:44–85摘要事件,描述执行过程中的事件。位于 io.agentscope.core.hook 包,继承自 HookEvent。核心成员包括 getModelName、getGenerateOptions、SummaryEvent。
Base class for summary-related events.
This sealed class provides common context for all summary events that occur when a ReActAgent reaches its maximum iterations and generates a summary:
-
#getModelName()- The model name (e.g., "qwen-plus", "gpt-4") -
#getGenerateOptions()- The generation options (temperature, etc.)
Subclasses represent different stages of the summary process:
-
PreSummaryEvent- Before summary generation -
SummaryChunkEvent- During streaming -
PostSummaryEvent- After summary generation completes
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected SummaryEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions) | 初始化 `SummaryEvent` 实例。 Constructor for SummaryEvent. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public final String getModelName()final | 获取模型名称。 Get the model name. |
public final GenerateOptions getGenerateOptions()final | 获取 `getGenerateOptions`。 Get the generation options. |
构造器详情Constructor Detail
SummaryEvent
protected SummaryEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions)
初始化 SummaryEvent 实例。
Constructor for SummaryEvent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | HookEventType | 类型(类型 `HookEventType`)。The event type (must not be null) |
agent | Agent | 智能体(类型 `Agent`)。The agent instance (must not be null) |
modelName | String | 模型名称(类型 `String`)。The model name (must not be null) |
generateOptions | GenerateOptions | generate 选项(类型 `GenerateOptions`)。The generation options (may be null if using model defaults) |
NullPointerException可能抛出 `NullPointerException`。if type, agent, or modelName is null
源码Source
io/agentscope/core/hook/SummaryEvent.java:60–65方法详情Method Detail
getModelName
public final String getModelName()
final
获取模型名称。
Get the model name.
String返回字符串结果。The model name (e.g., "qwen-plus", "gpt-4")
源码Source
io/agentscope/core/hook/SummaryEvent.java:72–74getGenerateOptions
public final GenerateOptions getGenerateOptions()
final
获取 getGenerateOptions。
Get the generation options.
GenerateOptions返回GenerateOptions。The generation options (temperature, maxTokens, etc.), or null if using model defaults
源码Source
io/agentscope/core/hook/SummaryEvent.java:82–84