AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:148–236

WebSocketTransportConfig的构建器。位于 io.agentscope.core.model.transport.websocket 包。核心成员包括 connectTimeout、readTimeout、writeTimeout、pingInterval、proxy、ignoreSsl。

Builder for WebSocketTransportConfig.

方法摘要Method Summary

方法Method说明Description
public Builder connectTimeout(Duration connectTimeout)
设置连接超时。
Set the connect timeout.
public Builder readTimeout(Duration readTimeout)
设置读取超时。
Set the read timeout.
public Builder writeTimeout(Duration writeTimeout)
设置写入超时。
Set the write timeout.
public Builder pingInterval(Duration pingInterval)
设置该配置项。
Set the ping interval for heartbeat (OkHttp only).
public Builder proxy(ProxyConfig proxyConfig)
设置代理配置。
Set the proxy configuration.
public Builder ignoreSsl(boolean ignoreSsl)
设置该配置项。
Set whether to ignore SSL certificate verification.
public WebSocketTransportConfig build()
构建WebSocketTransportConfig。
Build the WebSocketTransportConfig.

方法详情Method Detail

connectTimeout

public Builder connectTimeout(Duration connectTimeout)

设置连接超时。

Set the connect timeout.

参数Parameters
名称Name类型Type说明Description
connectTimeoutDuration连接超时时长。the connect timeout duration
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:162–165

readTimeout

public Builder readTimeout(Duration readTimeout)

设置读取超时。

Set the read timeout.

参数Parameters
名称Name类型Type说明Description
readTimeoutDuration读取超时时长。the read timeout duration
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:173–176

writeTimeout

public Builder writeTimeout(Duration writeTimeout)

设置写入超时。

Set the write timeout.

参数Parameters
名称Name类型Type说明Description
writeTimeoutDuration写入超时时长。the write timeout duration
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:184–187

pingInterval

public Builder pingInterval(Duration pingInterval)

设置该配置项。

Set the ping interval for heartbeat (OkHttp only).

参数Parameters
名称Name类型Type说明Description
pingIntervalDurationping 间隔(类型 `Duration`)。the ping interval duration
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:195–198

proxy

public Builder proxy(ProxyConfig proxyConfig)

设置代理配置。

Set the proxy configuration.

参数Parameters
名称Name类型Type说明Description
proxyConfigProxyConfig代理配置。the proxy configuration
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:208–211

ignoreSsl

public Builder ignoreSsl(boolean ignoreSsl)

设置该配置项。

Set whether to ignore SSL certificate verification.

参数Parameters
名称Name类型Type说明Description
ignoreSslbooleanignore Ssl(类型 `boolean`)。true to ignore SSL certificate verification, false otherwise
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:223–226

build

public WebSocketTransportConfig build()

构建WebSocketTransportConfig。

Build the WebSocketTransportConfig.

返回Returns WebSocketTransportConfig
一种新的WebSocketTransportConfig 实例。a new WebSocketTransportConfig instance
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportConfig.java:233–235
基于官方固定版本源码静态生成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.