类 PreSummaryEvent
java.lang.Object
io.agentscope.core.hook.HookEvent
io.agentscope.core.hook.SummaryEvent
io.agentscope.core.hook.PreSummaryEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
Event fired before summary generation when max iterations is reached.
Modifiable: Yes - setInputMessages(List), setGenerateOptions(GenerateOptions)
Context:
HookEvent.getAgent()- The agent instanceHookEvent.getMemory()- Agent's memorySummaryEvent.getModelName()- The model name (e.g., "qwen-plus")SummaryEvent.getGenerateOptions()- The generation options (temperature, etc.)getInputMessages()- Messages to send to LLM for summary (modifiable)getMaxIterations()- The maximum iterations configured for the agentgetCurrentIteration()- The current iteration count when summary triggered
Use Cases:
- Inject additional context into the summary prompt
- Modify the summary system instructions
- Change generation parameters for summary
- Log summary generation input
-
构造器概要
构造器构造器说明PreSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages, int maxIterations, int currentIteration) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreSummaryEvent. -
方法概要
修饰符和类型方法说明int已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the current iteration count when summary was triggered.已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the effective generation options.已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the messages that will be sent to LLM for summary generation.int已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the maximum iterations configured for the agent.voidsetGenerateOptions(GenerateOptions generateOptions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Set custom generation options for this summary call.voidsetInputMessages(List<Msg> inputMessages) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Modify the messages to send to LLM for summary.从类继承的方法 io.agentscope.core.hook.SummaryEvent
getGenerateOptions, getModelName从类继承的方法 io.agentscope.core.hook.HookEvent
appendSystemContent, appendSystemContent, getAgent, getMemory, getSystemMessage, getTimestamp, getType, setSystemMessage
-
构造器详细资料
-
PreSummaryEvent
public PreSummaryEvent(Agent agent, String modelName, GenerateOptions generateOptions, List<Msg> inputMessages, int maxIterations, int currentIteration) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Constructor for PreSummaryEvent.- 参数:
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 for summary (must not be null)maxIterations- The maximum iterations configured for the agentcurrentIteration- The current iteration count when summary triggered- 抛出:
NullPointerException- if agent, modelName, or inputMessages is null
-
-
方法详细资料
-
getInputMessages
已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the messages that will be sent to LLM for summary generation.- 返回:
- The input messages
-
setInputMessages
已过时, 待删除: 此 API 元素将从以后的版本中删除。Modify the messages to send to LLM for summary.- 参数:
inputMessages- The new message list (must not be null)- 抛出:
NullPointerException- if inputMessages is null
-
getMaxIterations
public int getMaxIterations()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the maximum iterations configured for the agent.- 返回:
- The maximum iterations
-
getCurrentIteration
public int getCurrentIteration()已过时, 待删除: 此 API 元素将从以后的版本中删除。Get the current iteration count when summary was triggered.- 返回:
- The current iteration count
-
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 summary call.This allows hooks to override the default generation options.
- 参数:
generateOptions- The custom generation options
-
MiddlewareBaseinstead.