AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:339–438

ProxyConfig的构建器。位于 io.agentscope.core.model.transport 包。核心成员包括 type、host、port、username、password、nonProxyHosts。

Builder for ProxyConfig.

方法摘要Method Summary

方法Method说明Description
public Builder type(ProxyType type)
设置代理类型。
Set the proxy type.
public Builder host(String host)
设置该配置项。
Set the proxy server hostname or IP address.
public Builder port(int port)
设置该配置项。
Set the proxy server port.
public Builder username(String username)
设置该配置项。
Set the authentication username.
public Builder password(String password)
设置密码。
Set the authentication password.
public Builder nonProxyHosts(Set<String> nonProxyHosts)
设置该配置项。
Set the hosts that should bypass the proxy.
public ProxyConfig build()
构建ProxyConfig。
Build the ProxyConfig.

方法详情Method Detail

type

public Builder type(ProxyType type)

设置代理类型。

Set the proxy type.

参数Parameters
名称Name类型Type说明Description
typeProxyType代理类型。the proxy type
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:355–358

host

public Builder host(String host)

设置该配置项。

Set the proxy server hostname or IP address.

参数Parameters
名称Name类型Type说明Description
hostStringhost(类型 `String`)。the proxy host
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:366–369

port

public Builder port(int port)

设置该配置项。

Set the proxy server port.

参数Parameters
名称Name类型Type说明Description
portintport(类型 `int`)。the proxy port
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:377–380

username

public Builder username(String username)

设置该配置项。

Set the authentication username.

参数Parameters
名称Name类型Type说明Description
usernameStringusername(类型 `String`)。the username
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:388–391

password

public Builder password(String password)

设置密码。

Set the authentication password.

参数Parameters
名称Name类型Type说明Description
passwordString密码。the password
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:399–402

nonProxyHosts

public Builder nonProxyHosts(Set<String> nonProxyHosts)

设置该配置项。

Set the hosts that should bypass the proxy.

参数Parameters
名称Name类型Type说明Description
nonProxyHostsSet<String>non 代理 Hosts(类型 `Set`)。the set of non-proxy hosts
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/ProxyConfig.java:418–421

build

public ProxyConfig build()

构建ProxyConfig。

Build the ProxyConfig.

返回Returns ProxyConfig
一种新的ProxyConfig 实例。a new ProxyConfig instance
抛出Throws
  • NullPointerException 可能抛出 `NullPointerException`。if type or host is null
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if port is out of range
源码Source io/agentscope/core/model/transport/ProxyConfig.java:430–437
基于官方固定版本源码静态生成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.