ReasoningEvent
@Deprecated(forRemoval = true, since = "2.0.0") public abstract sealed class ReasoningEvent extends HookEvent permits PreReasoningEvent, PostReasoningEvent, ReasoningChunkEvent
源码Source
io/agentscope/core/hook/ReasoningEvent.java:43–84推理事件,描述执行过程中的事件。位于 io.agentscope.core.hook 包,继承自 HookEvent。核心成员包括 getModelName、getGenerateOptions、ReasoningEvent。
Base class for reasoning-related events.
This sealed class provides common context for all reasoning events:
-
#getModelName()- The model name (e.g., "qwen-plus", "gpt-4") -
#getGenerateOptions()- The generation options (temperature, etc.)
Subclasses represent different stages of the reasoning process:
-
PreReasoningEvent- Before LLM call -
PostReasoningEvent- After LLM call -
ReasoningChunkEvent- During streaming
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected ReasoningEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions) | 初始化 `ReasoningEvent` 实例。 Constructor for ReasoningEvent. |
方法摘要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
ReasoningEvent
protected ReasoningEvent(HookEventType type, Agent agent, String modelName, GenerateOptions generateOptions)
初始化 ReasoningEvent 实例。
Constructor for ReasoningEvent.
参数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/ReasoningEvent.java:59–64方法详情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/ReasoningEvent.java:71–73getGenerateOptions
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/ReasoningEvent.java:81–83