AS AgentScopeAPI 手册 / API Reference

StudioUserAgent

public class StudioUserAgent extends AgentBase
源码Source io/agentscope/core/studio/StudioUserAgent.java:74–334

Studio 用户智能体,对智能体行为进行评测、追踪与可观测性分析。位于 io.agentscope.core.studio 包,继承自 AgentBase。核心成员包括 handleInterrupt、doCall、builder。

User proxy agent that represents human users in the agent system.

This agent allows human users to interact with other agents either through:

  • Terminal/Console input (default mode)

  • AgentScope Studio web interface (when Studio integration is enabled)

When integrated with Studio, the agent will:

  • Send a requestUserInput HTTP request to Studio

  • Studio displays an input form in the web UI

  • User enters input in the browser

  • Studio sends input back via WebSocket

  • Agent receives and processes the input

Usage with terminal:

`UserProxyAgent user = UserProxyAgent.builder()
.name("User")
.build();
`

Usage with Studio:

`UserProxyAgent user = UserProxyAgent.builder()
.name("User")
.studioClient(StudioManager.getClient())
.webSocketClient(StudioManager.getWebSocketClient())
.build();
`

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
UserProxyAgent的构建器。
Builder for UserProxyAgent.

方法摘要Method Summary

方法Method说明Description
protected Mono<Msg> handleInterrupt(InterruptContext context, Msg... originalArgs)
处理中断。
Handle interrupt scenarios.
public Mono<Msg> doCall(List<Msg> msgs)
执行调用操作。
Process a list of input messages
public static Builder builder()
static
创建新的UserProxyAgent 构建器。
Creates a new UserProxyAgent builder.

方法详情Method Detail

handleInterrupt

protected Mono<Msg> handleInterrupt(InterruptContext context, Msg... originalArgs)

处理中断。

Handle interrupt scenarios.

参数Parameters
名称Name类型Type说明Description
contextInterruptContext上下文(类型 `InterruptContext`)。The interrupt context containing metadata about the interruption
originalArgs varargsMsg...original 参数(类型 `Msg...`)。The original arguments passed to the call() method
返回Returns Mono<Msg>
返回Mono。Mono containing an interrupt message
源码Source io/agentscope/core/studio/StudioUserAgent.java:203–213

doCall

public Mono<Msg> doCall(List<Msg> msgs)

执行调用操作。

Process a list of input messages

参数Parameters
名称Name类型Type说明Description
msgsList<Msg>消息列表(类型 `List`)。Input messages (ignored)
返回Returns Mono<Msg>
返回Mono。User input message
源码Source io/agentscope/core/studio/StudioUserAgent.java:221–230

builder

public static Builder builder()
static

创建新的UserProxyAgent 构建器。

Creates a new UserProxyAgent builder.

返回Returns Builder
一种新的构建器实例。A new builder instance
源码Source io/agentscope/core/studio/StudioUserAgent.java:237–239

嵌套类详情Nested Class Detail

Builder

public static class Builder

UserProxyAgent的构建器。位于 io.agentscope.core.studio 包。核心成员包括 name、description、studioClient、webSocketClient、inputTimeout、build。

Builder for UserProxyAgent.

继承成员Inherited Members

继承自Methods inherited from Agent
继承自Methods inherited from CallableAgent
继承自Methods inherited from StreamableAgent
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.