AS AgentScopeAPI 手册 / API Reference

NetworkUtils

public class NetworkUtils
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:32–153

Network Utils,支持智能体之间的发现、委派与协作。位于 io.agentscope.runtime.protocol.a2a 包。核心成员包括 getServerIpAddress、getServerPort、getServerUrl、getConfigInfo、NetworkUtils。

Network utility class for getting current server IP address and port configuration

构造器摘要Constructor Summary

构造器Constructor说明Description
public NetworkUtils(DeployProperties serverConfig)
初始化 `NetworkUtils` 实例。
Creates a new instance.
public NetworkUtils(int serverPort, String serverAddress)
初始化 `NetworkUtils` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getServerIpAddress()
获取 `getServerIpAddress`。
Get current server IP address Uses address from configuration, or auto-detects local IP if not configured
public int getServerPort()
获取 `getServerPort`。
Get server port
public String getServerUrl(String path)
获取服务端 URL。
Get complete server URL
public String getConfigInfo()
获取配置信息。
Get configuration information (for debugging)

构造器详情Constructor Detail

NetworkUtils

public NetworkUtils(DeployProperties serverConfig)

初始化 NetworkUtils 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
serverConfigDeployProperties服务端配置(类型 `DeployProperties`)。The server config.
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:37–40

NetworkUtils

public NetworkUtils(int serverPort, String serverAddress)

初始化 NetworkUtils 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
serverPortint服务端 Port(类型 `int`)。The server port.
serverAddressString服务端 Address(类型 `String`)。The server address.
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:42–45

方法详情Method Detail

getServerIpAddress

public String getServerIpAddress()

获取 getServerIpAddress。

Get current server IP address Uses address from configuration, or auto-detects local IP if not configured

返回Returns String
返回字符串结果。server IP address
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:53–66

getServerPort

public int getServerPort()

获取 getServerPort。

Get server port

返回Returns int
返回数值结果。server port
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:73–75

getServerUrl

public String getServerUrl(String path)

获取服务端 URL。

Get complete server URL

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。path (optional)
返回Returns String
返回字符串结果。complete server URL
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:83–93

getConfigInfo

public String getConfigInfo()

获取配置信息。

Get configuration information (for debugging)

返回Returns String
返回字符串结果。configuration information string
源码Source io/agentscope/runtime/protocol/a2a/NetworkUtils.java:100–108
基于官方固定版本源码静态生成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.