类 StreamingHook
java.lang.Object
io.agentscope.core.agent.StreamingHook
- 所有已实现的接口:
Hook
@Deprecated(forRemoval=true,
since="2.0.0")
public class StreamingHook
extends Object
implements Hook
已过时, 待删除: 此 API 元素将从以后的版本中删除。
Internal hook implementation for streaming events.
Intercepts hook callbacks and emits Event instances to a FluxSink. Handles event
filtering and chunk mode processing.
-
构造器详细资料
-
StreamingHook
已过时, 待删除: 此 API 元素将从以后的版本中删除。Creates a new streaming hook.- 参数:
sink- The FluxSink to emit events tooptions- Configuration options for streaming
-
-
方法详细资料
-
onEvent
已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:HookHandle a hook event.This method is called for all agent execution events. Use pattern matching to handle specific event types.
Modifiable Events: For events with setters, you can modify the context and the changes will affect agent execution:
PreReasoningEvent- Modify messages before LLM reasoningPostReasoningEvent- Modify reasoning resultsPreActingEvent- Modify tool parameters before executionPostActingEvent- Modify tool resultsPreCallEvent- Modify messages before agent startsPostCallEvent- Modify final agent response
Notification Events: Events without setters are read-only:
ReasoningChunkEvent- Streaming reasoning chunksActingChunkEvent- Streaming tool execution chunksErrorEvent- Errors during execution
-
MiddlewareBasesystem. UseReActAgent.streamEvents(java.util.List)for fine-grained event streaming.