CosDistributedStore
public class CosDistributedStore implements DistributedStore
源码Source
io/agentscope/extensions/cos/CosDistributedStore.java:40–87COS 分布式存储,负责持久化与读取数据。位于 io.agentscope.extensions.cos 包,实现 DistributedStore。核心成员包括 create、agentStateStore、baseStore、sandboxSnapshotSpec。
Tencent Cloud COS-backed DistributedStore.
Usage:
`COSClient cosClient = new COSClient(cred, clientConfig);
HarnessAgent agent = HarnessAgent.builder()
.name("my-agent")
.model("dashscope:qwen-plus")
.distributedStore(CosDistributedStore.create(cosClient, "my-bucket", "agentscope/"))
.build();
`
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static CosDistributedStore create(COSClient cosClient, String bucketName, String keyPrefix)static | 创建COS 分布式存储。 Creates a COS distributed store. |
public AgentStateStore agentStateStore() | 返回智能体状态存储。 Returns the agent state store. |
public BaseStore baseStore() | 返回基类存储。 Returns the base store. |
public SandboxSnapshotSpec sandboxSnapshotSpec() | 返回沙箱快照规格。 Returns the sandbox snapshot spec. |
方法详情Method Detail
create
public static CosDistributedStore create(COSClient cosClient, String bucketName, String keyPrefix)
static
创建COS 分布式存储。
Creates a COS distributed store.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
cosClient | COSClient | COS 客户端(类型 `COSClient`)。initialized COS client |
bucketName | String | 存储桶名称(类型 `String`)。target bucket name |
keyPrefix | String | 键 Prefix(类型 `String`)。object key prefix (e.g. `"agentscope/"`) |
CosDistributedStore一种新的COS 分布式存储。a new COS distributed store
源码Source
io/agentscope/extensions/cos/CosDistributedStore.java:60–63agentStateStore
public AgentStateStore agentStateStore()
返回智能体状态存储。
Returns the agent state store.
AgentStateStore返回AgentStateStore。Returns agent state store.
源码Source
io/agentscope/extensions/cos/CosDistributedStore.java:65–72baseStore
public BaseStore baseStore()
返回基类存储。
Returns the base store.
BaseStore返回BaseStore。Returns base store.
源码Source
io/agentscope/extensions/cos/CosDistributedStore.java:74–81sandboxSnapshotSpec
public SandboxSnapshotSpec sandboxSnapshotSpec()
返回沙箱快照规格。
Returns the sandbox snapshot spec.
SandboxSnapshotSpec返回SandboxSnapshotSpec。Returns sandbox snapshot spec.
源码Source
io/agentscope/extensions/cos/CosDistributedStore.java:83–86