StreamableAgent
@Deprecated(since = "2.0.0", forRemoval = true) public interface StreamableAgent
io/agentscope/core/agent/StreamableAgent.java:43–211定义 Streamable 智能体契约的接口。位于 io.agentscope.core.agent 包。核心成员包括 stream。
Interface for agents that support streaming events during execution.
This interface enables real-time streaming of execution events as the agent processes input. Events can include reasoning steps, tool results, and final output.
Streaming is useful for:
-
Displaying incremental progress to users
-
Monitoring agent reasoning in real-time
-
Building interactive chat interfaces
方法摘要Method Summary
方法详情Method Detail
stream
default public Flux<Event> stream(StreamOptions options)
设置流。
Stream execution events based on current state without adding new input.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:54–57stream
default public Flux<Event> stream(Class<?> structuredModel)
设置流。
Stream execution events with structured output support based on current state.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure of the output |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:67–70stream
default public Flux<Event> stream(StreamOptions options, Class<?> structuredModel)
执行流相关操作。
Stream execution events with structured output support based on current state.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure of the output |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:81–84stream
default public Flux<Event> stream(Msg msg)
设置流。
Stream execution events for a single message with default options.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:94–97stream
default public Flux<Event> stream(Msg msg, StreamOptions options)
执行流相关操作。
Stream execution events for a single message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:108–111stream
default public Flux<Event> stream(Msg msg, StreamOptions options, Class<?> structuredModel)
执行流相关操作。
Stream execution events for a single message with structured output support.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure of the output |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:123–126stream
default public Flux<Event> stream(Msg msg, StreamOptions options, JsonNode schema)
执行流相关操作。
Stream execution events for a single message with JSON schema support.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msg | Msg | 消息(类型 `Msg`)。Input message |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:138–141stream
default public Flux<Event> stream(List<Msg> msgs)
设置流。
Stream execution events for multiple messages with default options.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:151–154stream
public Flux<Event> stream(List<Msg> msgs, StreamOptions options)
执行流相关操作。
Stream execution events in real-time as the agent processes the input.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:165–166stream
default public Flux<Event> stream(List<Msg> msgs, StreamOptions options, RuntimeContext context)
执行流相关操作。
Stream execution events with a caller-supplied per-call runtime context.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
context | RuntimeContext | 用于此调用的运行时元数据。Runtime metadata for this call |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:181–184stream
public Flux<Event> stream(List<Msg> msgs, StreamOptions options, Class<?> structuredModel)
执行流相关操作。
Stream execution events with structured output support.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
structuredModel | Class<?> | 结构化模型(类型 `Class`)。Class defining the structure of the output |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:196–197stream
public Flux<Event> stream(List<Msg> msgs, StreamOptions options, JsonNode schema)
执行流相关操作。
Stream execution events with JSON schema support.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
msgs | List<Msg> | 消息列表(类型 `List`)。Input messages |
options | StreamOptions | 选项(类型 `StreamOptions`)。Stream configuration options |
schema | JsonNode | 模式定义(类型 `JsonNode`)。JSON schema defining the structure |
Flux<Event>io/agentscope/core/agent/StreamableAgent.java:209–210