AS AgentScopeAPI 手册 / API Reference

ControlPlaneHttpClient

public final class ControlPlaneHttpClient
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:33–201

控制面 HTTP 客户端,封装与远端服务的连接和调用。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 baseUrl、mapper、send、sendBytes、sendForBytes、ControlPlaneHttpClient。

Shared JDK HttpClient wrapper for aistio control-plane REST calls.

Sends X-Builder-Internal-Token on every request and enforces a 10s timeout.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Response记录record
承载响应数据的记录类型。
HTTP response with a decoded string body.
BytesResponse记录record
承载字节响应数据的记录类型。
HTTP response with a raw byte body (e.g.

构造器摘要Constructor Summary

构造器Constructor说明Description
public ControlPlaneHttpClient(String baseUrl, String internalToken)
初始化 `ControlPlaneHttpClient` 实例。
Creates a client against the given control-plane base URL.

方法摘要Method Summary

方法Method说明Description
public String baseUrl()
返回基类 URL。
Returns the trimmed base URL.
public static ObjectMapper mapper()
static
返回 `mapper` 结果。
Returns the Jackson mapper shared by control-plane clients.
public Response send(String method, String path, Object jsonBody) throws IOException, InterruptedException
执行发送相关操作。
Sends a JSON request and returns the string body.
public Response send(String method, String path, Object jsonBody, Map<String, String> extraHeaders) throws IOException, InterruptedException
执行发送相关操作。
Sends a JSON request with extra headers.
public Response sendBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException
发送字节。
Sends a raw-bytes request (e.g.
public Response sendBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException
发送字节。
Sends raw bytes with additional request headers.
public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException
发送用于字节。
Sends a request and returns the raw response bytes (used for snapshot download).
public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException
发送用于字节。
Receives raw bytes with additional request headers.

构造器详情Constructor Detail

ControlPlaneHttpClient

public ControlPlaneHttpClient(String baseUrl, String internalToken)

初始化 ControlPlaneHttpClient 实例。

Creates a client against the given control-plane base URL.

参数Parameters
名称Name类型Type说明Description
baseUrlString基类 URL(类型 `String`)。control-plane HTTP base (trailing slash trimmed)
internalTokenString用于`X-Builder-Internal-Token`的值。value for `X-Builder-Internal-Token`
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:55–59

方法详情Method Detail

baseUrl

public String baseUrl()

返回基类 URL。

Returns the trimmed base URL.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:62–64

mapper

public static ObjectMapper mapper()
static

返回 mapper 结果。

Returns the Jackson mapper shared by control-plane clients.

返回Returns ObjectMapper
返回ObjectMapper。Returns object mapper.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:67–69

send

public Response send(String method, String path, Object jsonBody) throws IOException, InterruptedException

执行发送相关操作。

Sends a JSON request and returns the string body.

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。HTTP method
pathString路径(类型 `String`)。absolute path beginning with `/`, may include a query string
jsonBodyObjectJSON 正文(类型 `Object`)。request body object (serialized with Jackson), or `null` for no body
返回Returns Response
返回响应。Returns response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:78–81

send

public Response send(String method, String path, Object jsonBody, Map<String, String> extraHeaders) throws IOException, InterruptedException

执行发送相关操作。

Sends a JSON request with extra headers.

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。HTTP method
pathString路径(类型 `String`)。absolute path beginning with `/`
jsonBodyObjectJSON 正文(类型 `Object`)。request body object, or `null`
extraHeadersMap<String, String>extra 请求头(类型 `Map`)。additional request headers
返回Returns Response
返回响应。Returns response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:91–104

sendBytes

public Response sendBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException

发送字节。

Sends a raw-bytes request (e.g.

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。HTTP method
pathString路径(类型 `String`)。absolute path beginning with `/`
contentTypeString内容类型(类型 `String`)。`Content-Type` header, or `null` to omit
bodybyte[]用于无正文的请求正文字节,或`null`/`empty`。request body bytes, or `null`/`empty` for no body
返回Returns Response
返回响应。Returns response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:114–117

sendBytes

public Response sendBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException

发送字节。

Sends raw bytes with additional request headers.

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。The method.
pathString路径(类型 `String`)。The path.
contentTypeString内容类型(类型 `String`)。The content type.
bodybyte[]正文(类型 `byte[]`)。The body.
extraHeadersMap<String, String>extra 请求头(类型 `Map`)。The extra headers.
返回Returns Response
返回响应。Returns response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:120–138

sendForBytes

public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body) throws IOException, InterruptedException

发送用于字节。

Sends a request and returns the raw response bytes (used for snapshot download).

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。HTTP method
pathString路径(类型 `String`)。absolute path beginning with `/`
contentTypeString用于请求正文的可选内容类型。optional content type for a request body
bodybyte[]正文(类型 `byte[]`)。optional request body
返回Returns BytesResponse
返回BytesResponse。Returns bytes response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:148–151

sendForBytes

public BytesResponse sendForBytes(String method, String path, String contentType, byte[] body, Map<String, String> extraHeaders) throws IOException, InterruptedException

发送用于字节。

Receives raw bytes with additional request headers.

参数Parameters
名称Name类型Type说明Description
methodString方法(类型 `String`)。The method.
pathString路径(类型 `String`)。The path.
contentTypeString内容类型(类型 `String`)。The content type.
bodybyte[]正文(类型 `byte[]`)。The body.
extraHeadersMap<String, String>extra 请求头(类型 `Map`)。The extra headers.
返回Returns BytesResponse
返回BytesResponse。Returns bytes response.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
  • InterruptedException 可能抛出 `InterruptedException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/aistio/transport/ControlPlaneHttpClient.java:154–173

嵌套类详情Nested Class Detail

Response

public record Response(int status, String body)

承载响应数据的记录类型。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 status、body。

HTTP response with a decoded string body.

BytesResponse

public record BytesResponse(int status, byte[] body)

承载字节响应数据的记录类型。位于 io.agentscope.extensions.aistio.transport 包。核心成员包括 status、body。

HTTP response with a raw byte body (e.g. snapshot octet-streams).

基于官方固定版本源码静态生成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.