使用 ListMemoryStores 接口分页列出当前 AgentStorage 实例中的记忆库。每个列表项包含输入和输出类型,可用于区分结构化记忆、服务生成的文件和应用管理的文件。
前提条件
已创建 AgentStorage 实例且状态为
normal,并获取实例访问地址(endpoint)和实例名。已创建 API Key。
请求参数
字段 | 类型 | 必填 | 说明 |
| int | 否 | 本页最多返回数量。 |
| string | 否 | 上一页返回的不透明分页令牌。 |
请求示例
使用 API Key 认证时,通过 x-ots-instancename 和 x-ots-apikey 请求头传入实例名和 API Key。
curl -X POST https://<endpoint>/ListMemoryStores \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{}'响应
字段 | 说明 |
| 记忆库列表。 |
| 记忆库名称。 |
| 输入类型: |
| 输出类型集合,元素为 |
| 下一页令牌;没有更多数据时省略。 |
{
"stores": [
{
"memoryStoreName": "agent_memory",
"inputType": "messages",
"outputTypes": ["structured", "file"]
},
{
"memoryStoreName": "agent_files",
"inputType": "file",
"outputTypes": ["file"]
}
]
}该文章对您有帮助吗?