跳转到内容
EN

读取一轮的平台提示词 Rev(扩展)

GET/agent/v1/sessions/{session_id}/prompt-revs● 支持

请求参数

  • session_idstring必填

    path: Session id from session creation or listing, or the own face's session name for a main session.

  • run_idstring可选

    query: Read this run's own record. Omit it to read the last record written, which moves only when the Rev set changes and may be several turns older than this call.

  • acknowledge_wakestring必填

    query: Must be true. Says you know this read constructs the session object once and that its startup may settle an interrupted turn. Anything else is 400 INVALID_PARAMS, refused before the session is touched.

    取值 true

返回

200

仅在 /agent/v1 提供。返回 run_id、config_revision_id、config_version、platform、at 与 reaped_turns。platform 是一个 map,键是输入自己的名字:每个 prompt section 是 section:<name>,另有 catalog 与 tools 两个普通键;值是 8 位十六进制内容 Rev,不含任何提示词正文。带 run_id 读该轮自己的记录,不带则读最近一次写入的记录(它只在 Rev 集合变化时重写,可能比本次调用早好几轮,因此那时 run_id 为 null)。at 只供对时,从不参与比较。读取会构造会话对象一次(Durable Object 不经进入无法读取),启动可能接管中断的轮,故必须带 acknowledge_wake=true;reaped_turns 报这次读取本身接管了几轮,0 表示没有,只有大于 0 才可归因给这次读。当前返回不区分“新实例”与“重建后首探针”:该区分尚未出现在返回字段里,等 tablesInfo 的返回体发出 start_phase 时,两个读方法一起换。不写任何行,也不刷新会话缓存分片的淘汰排序键。没有记录与会话不可见都回 404,body 只有 reason:unknown_run 或 unknown_session,都不带任何记录字段。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

请求示例

curl
curl "https://api.deepraxis.com/agent/v1/sessions/sesn_abc123/prompt-revs?acknowledge_wake=true&run_id=run_7f3c" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
    f"{opts['base_url']}/v1/sessions/sesn_abc123/prompt-revs?acknowledge_wake=true&run_id=run_7f3c",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/sessions/sesn_abc123/prompt-revs?acknowledge_wake=true&run_id=run_7f3c`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

响应示例 200

{
  "found": true,
  "run_id": "run_7f3c",
  "config_revision_id": "agr_12",
  "config_version": 12,
  "platform": {
    "catalog": "a1b2c3d4",
    "section:memory": "0f1e2d3c",
    "section:computer": "99887766",
    "tools": "01234567"
  },
  "at": 1764000000000,
  "reaped_turns": 0
}

响应

HTTP 200

The turn’s record: no prompt text, only the identifiers of what it ran on.

application/json

名称 类型 说明
run_id string | null The run this record belongs to; null when the last record was read, because that record is written when the Rev set moves and is not tied to a turn.
config_revision_id string The configuration-layer revision the turn pinned.
config_version integer | null The version number config_revision_id carries, read from that revision's own row; null only on a record written before the version was read from the row, which stored a constant instead.
platform object One entry per platform input, keyed by the input's own name: section:<name> for a prompt section, plus catalog and tools. The value is that input's 8-hex content Rev, never its text.
at integer When the record was taken, epoch milliseconds. Informational only: it never takes part in a comparison.
reaped_turns integer Interrupted turns this read's own arrival settled; 0 when it settled none. Only a value above 0 is evidence about this call.