使用 GetWikiPage 接口按页面路径读取当前已发布页面的完整正文。
前提条件
已创建 AgentStorage 实例且状态为
normal,并获取实例访问地址(endpoint)和实例名。已创建 API Key。
Wiki 操作使用完整三段 Agent Scope(
appId/tenantId/agentId),每段非空且不能为*,最长 128 字节,不能包含/;不要传入runId。页面路径需来自
SearchWikiPages或ListWikiPages的返回,以/wiki/开头、以.md结尾。
请求参数
字段 | 类型 | 必填 | 说明 |
| string | 是 | 记忆库名称。 |
| object | 是 | 完整三段 Agent Scope,规则与 |
| string | 是 |
|
请求示例
使用 API Key 认证时,通过 x-ots-instancename 和 x-ots-apikey 请求头传入实例名和 API Key。
curl -X POST https://<endpoint>/GetWikiPage \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"memoryStoreName": "agent_memory",
"scope": {
"appId": "app-001",
"tenantId": "user-001",
"agentId": "assistant"
},
"path": "/wiki/payment-callback.md"
}'响应
Wiki 页面对象字段如下。
字段 | 说明 |
| 页面路径。 |
| 页面标题。 |
| 页面类型,例如 |
| 页面摘要或说明。 |
| Markdown 正文。仅 |
| 生成页面所依据的来源路径列表,例如 |
| 页面指向的 Wiki 页面路径。 |
| 指向当前页面的 Wiki 页面路径,最多返回 256 条。 |
| 指向当前页面的完整链接数量。 |
|
|
| 搜索得分,仅 |
{
"path": "/wiki/payment-callback.md",
"title": "支付回调",
"type": "guide",
"description": "支付回调的幂等与验签要求",
"content": "# 支付回调\n\n支付回调必须校验幂等键。",
"sources": [
"raw/product/payment.md"
],
"outgoingLinks": [
"/wiki/payment-overview.md"
],
"incomingLinkCount": 1
}