AS AgentScopeAPI 手册 / API Reference

BaseStore

public interface BaseStore
源码Source io/agentscope/harness/agent/filesystem/remote/store/BaseStore.java:27–96

定义基类存储契约的接口。位于 io.agentscope.harness.agent.filesystem.remote.store 包。核心成员包括 get、put、putIfVersion、search、delete。

Abstract interface for a namespace-based key-value store.

Items are organized by namespaces (hierarchical path-like tuples) and identified by a key within each namespace.

方法摘要Method Summary

方法Method说明Description
public StoreItem get(List<String> namespace, String key)
按条件读取数据。
Get a single item by namespace and key.
public void put(List<String> namespace, String key, Map<String, Object> value)
执行 `put` 方法。
Store or update an item.
default public boolean putIfVersion(List<String> namespace, String key, Map<String, Object> value, long expectedVersion)
default
执行 `putIfVersion` 方法。
Conditional update: stores the item only when the current stored version matches `expectedVersion`.
public List<StoreItem> search(List<String> namespace, int limit, int offset)
执行搜索相关操作。
Search for items within a namespace with pagination.
public void delete(List<String> namespace, String key)
删除数据。
Delete an item by namespace and key.

方法详情Method Detail

get

public StoreItem get(List<String> namespace, String key)

按条件读取数据。

Get a single item by namespace and key.

参数Parameters
名称Name类型Type说明Description
namespaceList<String>命名空间(类型 `List`)。hierarchical namespace path
keyString键(类型 `String`)。the item key within the namespace
返回Returns StoreItem
存储条目,或`null`if 不找到。the store item, or `null` if not found
源码Source io/agentscope/harness/agent/filesystem/remote/store/BaseStore.java:36

put

public void put(List<String> namespace, String key, Map<String, Object> value)

执行 put 方法。

Store or update an item.

参数Parameters
名称Name类型Type说明Description
namespaceList<String>命名空间(类型 `List`)。hierarchical namespace path
keyString键(类型 `String`)。the item key within the namespace
valueMap<String, Object>数据到存储。the data to store
源码Source io/agentscope/harness/agent/filesystem/remote/store/BaseStore.java:45

putIfVersion

default public boolean putIfVersion(List<String> namespace, String key, Map<String, Object> value, long expectedVersion)
default

执行 putIfVersion 方法。

Conditional update: stores the item only when the current stored version matches expectedVersion.

参数Parameters
名称Name类型Type说明Description
namespaceList<String>命名空间(类型 `List`)。hierarchical namespace path
keyString键(类型 `String`)。the item key within the namespace
valueMap<String, Object>新的数据到存储。the new data to store
expectedVersionlongexpected 版本(类型 `long`)。the version the caller observed; must match the current stored version
返回Returns boolean
返回布尔值,表示判断结果。`true` if the item was written, `false` if the version did not match
源码Source io/agentscope/harness/agent/filesystem/remote/store/BaseStore.java:74–77

delete

public void delete(List<String> namespace, String key)

删除数据。

Delete an item by namespace and key.

参数Parameters
名称Name类型Type说明Description
namespaceList<String>命名空间(类型 `List`)。hierarchical namespace path
keyString条目密钥到删除。the item key to delete
源码Source io/agentscope/harness/agent/filesystem/remote/store/BaseStore.java:95
基于官方固定版本源码静态生成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.