类 StreamUserInput
java.lang.Object
io.agentscope.core.agent.user.StreamUserInput
- 所有已实现的接口:
UserInputBase
@Deprecated(forRemoval=true,
since="2.0.0")
public class StreamUserInput
extends Object
implements UserInputBase
已过时, 待删除: 此 API 元素将从以后的版本中删除。
Stream-based user input implementation that reads from any InputStream and writes to any
OutputStream. By default, uses System.in and System.out for console interaction.
Supports both simple text input and structured data input via key=value pairs. Blocking I/O operations are executed on the bounded elastic scheduler to maintain reactive compatibility.
Usage examples:
// Default console input/output
StreamUserInput consoleInput = StreamUserInput.builder().build();
// Custom streams (e.g., for testing)
StreamUserInput customInput = StreamUserInput.builder()
.inputStream(myInputStream)
.outputStream(myOutputStream)
.inputHint("Enter: ")
.build();
-
嵌套类概要
嵌套类修饰符和类型类说明static class已过时, 待删除: 此 API 元素将从以后的版本中删除。Builder for StreamUserInput. -
方法概要
修饰符和类型方法说明static StreamUserInput.Builderbuilder()已过时, 待删除: 此 API 元素将从以后的版本中删除。Create a new builder for StreamUserInput.reactor.core.publisher.Mono<UserInputData> 已过时, 待删除: 此 API 元素将从以后的版本中删除。Handle user input from the configured input stream.
-
方法详细资料
-
builder
已过时, 待删除: 此 API 元素将从以后的版本中删除。Create a new builder for StreamUserInput.- 返回:
- A new builder instance
-
handleInput
public reactor.core.publisher.Mono<UserInputData> handleInput(String agentId, String agentName, List<Msg> contextMessages, Class<?> structuredModel) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Handle user input from the configured input stream. Prints any context messages before prompting the user with the configured input hint, reads a line of text, and optionally collects structured data if a model class is provided. Returns a UserInputData containing both the text content blocks and any structured input.- 指定者:
handleInput在接口中UserInputBase- 参数:
agentId- The agent identifier (unused in this implementation)agentName- The agent name (unused in this implementation)contextMessages- Optional messages to display before prompting (e.g., assistant response)structuredModel- Optional class for structured input format- 返回:
- Mono containing the user input data
-