Page through parsed task source text

Read parsed source text within the task using pagination.

POST https://api.moi.matrixorigin.cn/v5/semantic-models/runtime/read-document

Before you call this API

Use injected service URLs, technical credentials, Workspace, and short-lived authorization only in the current task environment. Retain original authorization header values. An ordinary PAT cannot replace task identity or establish authorization. Examples use jq. See Shared information for variables, objects, and states.

Request body

curl -X POST "${MOI_ENDPOINT%/}/semantic-models/runtime/read-document" \
  -H "X-API-Key: $MOI_API_KEY" \
  -H "X-Workspace-ID: $MOI_WORKSPACE_ID" \
  -H "X-MOI-Runtime-Authorization: $MOI_RUNTIME_AUTHORIZATION" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --arg REQUEST_ID "$REQUEST_ID" --arg MARKDOWN_FILE_ID "$MARKDOWN_FILE_ID" '
{
  "request_id": $REQUEST_ID,
  "markdown_file_id": $MARKDOWN_FILE_ID,
  "cursor": 0,
  "limit_chars": 4000
}
')"

Reads text reconstructed from current effective chunks in authorized sources. Continue with next_cursor until0. This operation has no evidence-window has_more. Do not calculate offsets in bytes or infer Markdown file IDs.

Fields

Type

Required

Description

request_id

string

Yes

Unique ID for this operation, 1–256 bytes, without surrounding whitespace or an audit: prefix. Retain for replay of identical input.

markdown_file_id

string

Yes

Markdown location ID from the original evidence.

cursor

integer

No

Unicode character offset, default 0; negative values rejected.

limit_chars

integer

No

Nonpositive/omitted uses 8000, maximum 20000.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "call_id": "request_example",
    "output": {
      "markdown_file_id": "markdown_example",
      "file_name": "example.md",
      "total_chars": 4,
      "cursor": 0,
      "returned_chars": 4,
      "next_cursor": 0,
      "content": "示例原文",
      "metadata": {}
    }
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

Response explanation.

data.call_id

string

Corresponding original request_id.

data.failed

boolean

true indicates business failure; false may be omitted.

data.output

object

Current operation result.

data.artifacts

object (array of objects)

Original artifacts and evidence from the same task.

data.metadata

object

Operation metadata, returned when present.

data.output.markdown_file_id

string

Raw value returned by the current operation; retain according to common objects.

data.output.file_name

string

Raw value returned by the current operation; retain according to common objects.

data.output.total_chars

integer

Raw value returned by the current operation; retain according to common objects.

data.output.cursor

integer

Raw value returned by the current operation; retain according to common objects.

data.output.returned_chars

integer

Raw value returned by the current operation; retain according to common objects.

data.output.next_cursor

integer

Continue according to the current read mode. Markdown ends at 0.

data.output.content

string

Original text in the current window.

data.output.metadata

object

Raw value returned by the current operation; retain according to common objects.

Error response

Handle HTTP status, business results, and error fields separately. See Errors and environments. On source or version conflicts, read current state; do not automatically retry with a different identity, resource, or request ID.

Last updated on