类 PreReasoningEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.ReasoningEvent
io.agentscope.core.hook.PreReasoningEvent
@Deprecated(forRemoval=true,
since="2.0.0")
public final class PreReasoningEvent
extends ReasoningEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
Event fired before LLM reasoning.
Modifiable: Yes - setInputMessages(List)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memoryReasoningEvent.getModelName()- The model name (e.g., "qwen-plus")ReasoningEvent.getGenerateOptions()- The generation options (temperature, etc.)getInputMessages()- Messages to send to LLM (modifiable)
Use Cases:
- Inject hints or additional context into the prompt
- Filter or modify existing messages
- Add system instructions dynamically
- Log reasoning input
-
构造器概要
构造器构造器说明PreReasoningEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreReasoningEvent. -
方法概要
修饰符和类型方法说明已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the effective generation options.已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the messages that will be sent to LLM for reasoning.voidsetGenerateOptions(GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Set custom generation options for this reasoning call.voidsetInputMessages(List<Msg> inputMessages) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Modify the messages to send to LLM.从类继承的方法 io.agentscope.core.hook.ReasoningEvent
getGenerateOptions, getModelName从类继承的方法 io.agentscope.core.hook.HookEvent
appendSystemContent, appendSystemContent, getAgent, getMemory, getSystemMessage, getTimestamp, getType, setSystemMessage
-
构造器详细资料
-
PreReasoningEvent
public PreReasoningEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreReasoningEvent.- 参数:
agent- The agent instance (must not be null)modelName- The model name (must not be null)generateOptions- The generation options (may be null)inputMessages- The messages to send to LLM (must not be null)- 抛出:
NullPointerException- if agent, modelName, or inputMessages is null
-
-
方法详细资料
-
getInputMessages
已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the messages that will be sent to LLM for reasoning.- 返回:
- The input messages
-
setInputMessages
已过时, 待删除: 此 API 元素将从以后的版本中删除。Modify the messages to send to LLM.- 参数:
inputMessages- The new message list (must not be null)- 抛出:
NullPointerException- if inputMessages is null
-
getEffectiveGenerateOptions
已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the effective generation options.Returns the overridden options if set via
setGenerateOptions(GenerateOptions), otherwise returns the original options from the parent class.- 返回:
- The effective generation options
-
setGenerateOptions
已过时, 待删除: 此 API 元素将从以后的版本中删除。Set custom generation options for this reasoning call.This allows hooks to override the default generation options, for example to set a specific tool_choice for structured output.
- 参数:
generateOptions- The custom generation options
-
MiddlewareBaseinstead.