StreamingHook
@Deprecated(forRemoval = true, since = "2.0.0") @SuppressWarnings("deprecation") public class StreamingHook implements Hook
源码Source
io/agentscope/core/agent/StreamingHook.java:47–169流式钩子,驱动智能体的推理、工具调用与会话执行。位于 io.agentscope.core.agent 包,实现 Hook。核心成员包括 onEvent、StreamingHook。
Internal hook implementation for streaming events.
Intercepts hook callbacks and emits Event instances to a FluxSink. Handles event
filtering and chunk mode processing.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public StreamingHook(FluxSink<Event> sink, StreamOptions options) | 创建新的流式钩子。 Creates a new streaming hook. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public T extends HookEvent Mono<T> onEvent(T event) | 处理事件事件。 Performs the on event operation. |
构造器详情Constructor Detail
StreamingHook
public StreamingHook(FluxSink<Event> sink, StreamOptions options)
创建新的流式钩子。
Creates a new streaming hook.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sink | FluxSink<Event> | FluxSink 到发出事件到。The FluxSink to emit events to |
options | StreamOptions | 用于流式的配置选项。Configuration options for streaming |
源码Source
io/agentscope/core/agent/StreamingHook.java:63–66方法详情Method Detail
onEvent
public T extends HookEvent Mono<T> onEvent(T event)
处理事件事件。
Performs the on event operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
event | T | 事件(类型 `T`)。The event. |
Mono<T>返回Mono。Returns mono.
源码Source
io/agentscope/core/agent/StreamingHook.java:68–127