Package io.agentscope.extensions.oss
Class OssBaseStore
java.lang.Object
io.agentscope.extensions.oss.OssBaseStore
- All Implemented Interfaces:
io.agentscope.harness.agent.filesystem.remote.store.BaseStore
public class OssBaseStore
extends Object
implements io.agentscope.harness.agent.filesystem.remote.store.BaseStore
Alibaba Cloud OSS backed
BaseStore for the harness remote filesystem.
Items are stored as JSON objects in OSS. The object key layout is:
{keyPrefix}{namespace[0]}/{namespace[1]}/.../{key}.json — item data
{keyPrefix}{namespace[0]}/{namespace[1]}/.../{key}.version — version counter
Usage:
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
BaseStore store = OssBaseStore.builder()
.ossClient(ossClient)
.bucketName("my-agentscope-bucket")
.keyPrefix("agentscope/store/")
.build();
HarnessAgent agent = HarnessAgent.builder()
.filesystem(new RemoteFilesystemSpec(store))
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic OssBaseStore.Builderbuilder()voidio.agentscope.harness.agent.filesystem.remote.store.StoreItemvoidbooleanList<io.agentscope.harness.agent.filesystem.remote.store.StoreItem>
-
Method Details
-
builder
-
get
public io.agentscope.harness.agent.filesystem.remote.store.StoreItem get(List<String> namespace, String key) - Specified by:
getin interfaceio.agentscope.harness.agent.filesystem.remote.store.BaseStore
-
put
- Specified by:
putin interfaceio.agentscope.harness.agent.filesystem.remote.store.BaseStore
-
putIfVersion
public boolean putIfVersion(List<String> namespace, String key, Map<String, Object> value, long expectedVersion) - Specified by:
putIfVersionin interfaceio.agentscope.harness.agent.filesystem.remote.store.BaseStore
-
search
public List<io.agentscope.harness.agent.filesystem.remote.store.StoreItem> search(List<String> namespace, int limit, int offset) - Specified by:
searchin interfaceio.agentscope.harness.agent.filesystem.remote.store.BaseStore
-
delete
- Specified by:
deletein interfaceio.agentscope.harness.agent.filesystem.remote.store.BaseStore
-