AgentBayClient
public class AgentBayClient extends BaseClient
io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:32–175智能体 Bay 客户端,封装与远端服务的连接和调用。位于 io.agentscope.runtime.sandbox.manager.client 包,继承自 BaseClient。核心成员包括 connect、createContainer、startContainer、stopContainer、removeContainer、getSessionInfo。
A class in io.agentscope.runtime.sandbox.manager.client that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.manager.client. Extends BaseClient.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentBayClient(String apiKey) | 初始化 `AgentBayClient` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
AgentBayClient
public AgentBayClient(String apiKey)
初始化 AgentBayClient 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。The api key. |
io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:38–45方法详情Method Detail
connect
public boolean connect()
建立连接并完成初始化。
Returns the connect.
booleanio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:47–50createContainer
public ContainerCreateResult createContainer(String imageId, Map<String, String> labels)
创建容器。
Creates the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageId | String | 图像标识(类型 `String`)。The image id. |
labels | Map<String, String> | labels(类型 `Map`)。The labels. |
ContainerCreateResultio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:52–71createContainer
public ContainerCreateResult createContainer(String containerName, String imageName, List<String> ports, List<VolumeBinding> volumeBindings, Map<String, String> environment, Map<String, Object> runtimeConfig)
创建容器。
Creates the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerName | String | 容器名称(类型 `String`)。The container name. |
imageName | String | 图像名称(类型 `String`)。The image name. |
ports | List<String> | ports(类型 `List`)。The ports. |
volumeBindings | List<VolumeBinding> | volume Bindings(类型 `List`)。The volume bindings. |
environment | Map<String, String> | 环境(类型 `Map`)。The environment. |
runtimeConfig | Map<String, Object> | 运行时配置(类型 `Map`)。The runtime config. |
ContainerCreateResultio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:73–76startContainer
public void startContainer(String containerId)
启动容器。
Starts the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:78–81stopContainer
public void stopContainer(String containerId)
停止容器。
Stops the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:83–86removeContainer
public void removeContainer(String containerId)
移除容器。
Removes the container.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:88–106getSessionInfo
public Map<String, Object> getSessionInfo(String sessionId)
获取会话信息。
Returns the session info.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:108–135getSession
public Session getSession(String sessionId)
获取会话。
Returns the session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Sessionio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:137–149getContainerStatus
public String getContainerStatus(String containerId)
获取容器状态。
Returns the container status.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
Stringio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:151–154isConnected
public boolean isConnected()
判断是否已连接。
Returns whether the connected.
booleanio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:156–159imageExists
public boolean imageExists(String imageName)
设置该参数。
Performs the image exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
booleanio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:161–164inspectContainer
public boolean inspectContainer(String containerIdOrName)
设置该参数。
Performs the inspect container operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerIdOrName | String | 容器标识或名称(类型 `String`)。The container id or name. |
booleanio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:166–169pullImage
public boolean pullImage(String imageName)
设置该参数。
Performs the pull image operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
imageName | String | 图像名称(类型 `String`)。The image name. |
booleanio/agentscope/runtime/sandbox/manager/client/AgentBayClient.java:171–174