智能体

读取会话资源

读取会话上一份附加资源的详情。

先调用「创建会话」,用返回的会话 ID 替换示例 ID。 先调用「添加会话资源」,用返回的资源 ID 替换 sesrsc_123。

GET /agent/v1/sessions/{session_id}/resources/{resource_id}◐ 部分支持

请求参数

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • resource_idstring必填

    path: Id of a resource attached to the session, as returned by sessions.resources.add or sessions.resources.list.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

返回

200

支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。

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

响应

HTTP 200

Successful response

application/json

名称类型说明
idstringResource id, the resource_id of sessions.resources calls.
created_atstringA timestamp in RFC 3339 format
mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.
typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
updated_atstringA timestamp in RFC 3339 format
urlstringRepository URL.
checkoutnull | objectBranch or commit to check out.
checkout.namestringBranch name to check out.
checkout.typestringAlways `branch`. Check out the named branch. / Always `commit`. Check out the commit with the given SHA.
checkout.shastringFull commit SHA to check out.
file_idstringId of the uploaded file; it must exist and belong to your tenant.
memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
accessnull | stringAccess mode for an attached memory store.
descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.