接口 StreamableAgent

所有已知子接口:
Agent
所有已知实现类:
AgentBase, ReActAgent, UserAgent

@Deprecated(since="2.0.0", forRemoval=true) public interface StreamableAgent
已过时, 待删除: 此 API 元素将从以后的版本中删除。
since 2.0.0, for removal in a future minor release. Every stream(...) method on this interface returns the coarse-grained Event type, which is a v1 carry-over. Use ReActAgent#streamEvents(...) instead — it returns Flux<io.agentscope.core.event.AgentEvent>, the fine-grained event hierarchy that covers the full agent lifecycle (28 typed events including HITL) and is the single streaming surface going forward. See the v2 changelog section B.4 for migration details.
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
  • 方法概要

    修饰符和类型
    方法
    说明
    default reactor.core.publisher.Flux<Event>
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(StreamOptions options, Class<?> structuredModel)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(Msg msg)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(Msg msg, StreamOptions options)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(Msg msg, StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(Msg msg, StreamOptions options, Class<?> structuredModel)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(Class<?> structuredModel)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(List<Msg> msgs)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    reactor.core.publisher.Flux<Event>
    stream(List<Msg> msgs, StreamOptions options)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    reactor.core.publisher.Flux<Event>
    stream(List<Msg> msgs, StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    default reactor.core.publisher.Flux<Event>
    stream(List<Msg> msgs, StreamOptions options, RuntimeContext context)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
    reactor.core.publisher.Flux<Event>
    stream(List<Msg> msgs, StreamOptions options, Class<?> structuredModel)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    since 2.0.0, for removal.
  • 方法详细资料

    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(StreamOptions options)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events based on current state without adding new input.
      参数:
      options - Stream configuration options
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(Class<?> structuredModel)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events with structured output support based on current state.
      参数:
      structuredModel - Class defining the structure of the output
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(StreamOptions options, Class<?> structuredModel)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events with structured output support based on current state.
      参数:
      options - Stream configuration options
      structuredModel - Class defining the structure of the output
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(Msg msg)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(Msg) for the fine-grained AgentEvent stream.
      Stream execution events for a single message with default options.
      参数:
      msg - Input message
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(Msg msg, StreamOptions options)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(Msg) for the fine-grained AgentEvent stream.
      Stream execution events for a single message.
      参数:
      msg - Input message
      options - Stream configuration options
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(Msg msg, StreamOptions options, Class<?> structuredModel)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events for a single message with structured output support.
      参数:
      msg - Input message
      options - Stream configuration options
      structuredModel - Class defining the structure of the output
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(Msg msg, StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events for a single message with JSON schema support.
      参数:
      msg - Input message
      options - Stream configuration options
      schema - JSON schema defining the structure
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(List<Msg> msgs)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(List) for the fine-grained AgentEvent stream.
      Stream execution events for multiple messages with default options.
      参数:
      msgs - Input messages
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) reactor.core.publisher.Flux<Event> stream(List<Msg> msgs, StreamOptions options)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(List) for the fine-grained AgentEvent stream.
      Stream execution events in real-time as the agent processes the input.
      参数:
      msgs - Input messages
      options - Stream configuration options
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) default reactor.core.publisher.Flux<Event> stream(List<Msg> msgs, StreamOptions options, RuntimeContext context)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events with a caller-supplied per-call runtime context.

      Implementations that do not consume RuntimeContext can rely on this default bridge and continue using the original two-argument stream method.

      参数:
      msgs - Input messages
      options - Stream configuration options
      context - Runtime metadata for this call
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) reactor.core.publisher.Flux<Event> stream(List<Msg> msgs, StreamOptions options, Class<?> structuredModel)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events with structured output support.
      参数:
      msgs - Input messages
      options - Stream configuration options
      structuredModel - Class defining the structure of the output
      返回:
      Flux of events emitted during execution
    • stream

      @Deprecated(since="2.0.0", forRemoval=true) reactor.core.publisher.Flux<Event> stream(List<Msg> msgs, StreamOptions options, com.fasterxml.jackson.databind.JsonNode schema)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      since 2.0.0, for removal. Use ReActAgent#streamEvents(...) for the fine-grained AgentEvent stream.
      Stream execution events with JSON schema support.
      参数:
      msgs - Input messages
      options - Stream configuration options
      schema - JSON schema defining the structure
      返回:
      Flux of events emitted during execution