OssDistributedStore
public class OssDistributedStore implements DistributedStore
源码Source
io/agentscope/extensions/oss/OssDistributedStore.java:39–85OSS 分布式存储,负责持久化与读取数据。位于 io.agentscope.extensions.oss 包,实现 DistributedStore。核心成员包括 create、agentStateStore、baseStore、sandboxSnapshotSpec。
Alibaba Cloud OSS-backed DistributedStore.
Usage:
`OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
HarnessAgent agent = HarnessAgent.builder()
.name("my-agent")
.model("dashscope:qwen-plus")
.distributedStore(OssDistributedStore.create(ossClient, "my-bucket", "agentscope/"))
.build();
`
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static OssDistributedStore create(OSS ossClient, String bucketName, String keyPrefix)static | 创建OSS 分布式存储。 Creates an OSS 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 OssDistributedStore create(OSS ossClient, String bucketName, String keyPrefix)
static
创建OSS 分布式存储。
Creates an OSS distributed store.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ossClient | OSS | OSS 客户端(类型 `OSS`)。initialized OSS client |
bucketName | String | 存储桶名称(类型 `String`)。target bucket name |
keyPrefix | String | 键 Prefix(类型 `String`)。object key prefix (e.g. `"agentscope/"`) |
OssDistributedStore一种新的OSS 分布式存储。a new OSS distributed store
源码Source
io/agentscope/extensions/oss/OssDistributedStore.java:59–61agentStateStore
public AgentStateStore agentStateStore()
返回智能体状态存储。
Returns the agent state store.
AgentStateStore返回AgentStateStore。Returns agent state store.
源码Source
io/agentscope/extensions/oss/OssDistributedStore.java:63–70baseStore
public BaseStore baseStore()
返回基类存储。
Returns the base store.
BaseStore返回BaseStore。Returns base store.
源码Source
io/agentscope/extensions/oss/OssDistributedStore.java:72–79sandboxSnapshotSpec
public SandboxSnapshotSpec sandboxSnapshotSpec()
返回沙箱快照规格。
Returns the sandbox snapshot spec.
SandboxSnapshotSpec返回SandboxSnapshotSpec。Returns sandbox snapshot spec.
源码Source
io/agentscope/extensions/oss/OssDistributedStore.java:81–84