VEGA 引擎 · 语义理解任务 API (0.1.0)

Download OpenAPI specification:

Vega Backend asynchronous semantic-understanding task API. New tasks can target one Resource. Catalog task creation and execution are temporarily unavailable; existing Catalog tasks remain readable and deletable. The worker submits Resource tasks to bkn-agent and writes back results and application status asynchronously. Completed Resource dry-run tasks can apply their saved result without another Agent invocation, subject to the original confidence threshold and a matching schema fingerprint.

List semantic-understanding tasks

Authorizations:
OAuth2
query Parameters
scope
string
Enum: "resource" "catalog"
catalog_id
string
resource_id
string
status
Array of strings
Items Enum: "pending" "running" "completed" "failed" "cancelled"

Filter by status. Repeat the parameter for multiple statuses, which are combined with OR.

apply_mode
string
Enum: "dry_run" "fill_empty" "force"

Original task creation mode. Manual application does not change this value.

applied
boolean

Whether the result has been applied.

offset
integer >= 0
Default: 0
limit
integer [ -1 .. 1000 ]
Default: 20

Page size from 1 to 1000. Use -1 to disable pagination. Defaults to 20.

sort
string
Default: "create_time"
Enum: "create_time" "start_time" "finish_time"

Sort field. Tasks with start_time or finish_time equal to 0 are sorted as ordinary numeric values.

direction
string
Default: "desc"
Enum: "asc" "desc"

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "total_count": 0
}

Create a semantic-understanding task

Authorizations:
OAuth2
Request Body schema: application/json
required
One of
scope
required
string
Value: "resource"
Value: "resource"
resource_id
required
string
language
string
Enum: "zh-CN" "en-US" ""

新生成业务名称、描述和警告的输出语言;省略或为空时使用 Accept-Language 解析结果;请求头未提供受支持的语言时,使用服务器部署时配置的默认语言。创建时写入任务输入快照,后续界面语言变化不影响已创建任务。

apply_mode
string
Default: "fill_empty"
Enum: "dry_run" "fill_empty" "force"
confidence_threshold
number <double>
Default: 0.75
include_sample_rows
boolean

Whether to read and send raw sample rows. Supported only for Resource semantic-understanding tasks. If sampling is unavailable, the task is still created and continues with no sample rows.

object (SamplePolicy)

Responses

Request samples

Content type
application/json
Example
{
  • "scope": "resource",
  • "resource_id": "string",
  • "language": "zh-CN",
  • "apply_mode": "dry_run",
  • "confidence_threshold": 0.75,
  • "include_sample_rows": true,
  • "sample_policy": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "scope": "resource",
  • "catalog_id": "string",
  • "catalog_name": "string",
  • "resource_id": "string",
  • "resource_name": "string",
  • "agent_task_id": "string",
  • "agent_id": "string",
  • "input": "string",
  • "input_hash": "string",
  • "status": "pending",
  • "apply_mode": "dry_run",
  • "result_json": "string",
  • "confidence_threshold": 0.1,
  • "confidence": 0.1,
  • "confidence_detail_json": "string",
  • "apply_detail_json": "string",
  • "applied": true,
  • "failure_detail": "string",
  • "creator": {
    },
  • "create_time": 0,
  • "start_time": 0,
  • "finish_time": 0
}

Apply the saved result of a Resource dry-run task

Requires task_manage on the task's Catalog and modify on its Resource (inherited from Catalog resource_manage), subject to built-in resource restrictions. Only completed Resource tasks originally created with apply_mode=dry_run are eligible. Uses the saved result without creating another task or invoking the Agent. The original task mode, input, result, and confidence threshold are preserved. The actual write mode is recorded as apply_mode in apply_detail_json.

The result must meet the original confidence threshold. The task's stored schema snapshot must match the current Resource schema using a fingerprint that includes complete field membership, names, types, original field names/types/comments, and attributes. Field order and object key order do not affect the fingerprint; attribute arrays retain their order and types. Business display metadata and operational configuration are excluded. Historical tasks use the same computation; missing, null, and empty-object attributes are equivalent. Nonempty current attributes cannot be substituted into an old snapshot. Force mode cannot bypass confidence, schema, or source identity checks.

Metadata writes and application state are committed atomically. A previously applied task returns its existing state without repeating writes, even if the requested mode differs. A successful manual application always sets applied=true, including when no resource metadata needs changing. Inspect apply_detail_json for the no-change reason or skipped fields; applying another strategy requires a new task. The input field is protected using the same query_data rule as the single-task detail response.

Authorizations:
OAuth2
path Parameters
id
required
string
Request Body schema: application/json
required
apply_mode
required
string
Enum: "fill_empty" "force"

Required write strategy for this application. Does not change the task's original dry_run mode or confidence threshold.

Responses

Request samples

Content type
application/json
{
  • "apply_mode": "fill_empty"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "scope": "resource",
  • "catalog_id": "string",
  • "catalog_name": "string",
  • "resource_id": "string",
  • "resource_name": "string",
  • "agent_task_id": "string",
  • "agent_id": "string",
  • "input": "string",
  • "input_hash": "string",
  • "status": "pending",
  • "apply_mode": "dry_run",
  • "result_json": "string",
  • "confidence_threshold": 0.1,
  • "confidence": 0.1,
  • "confidence_detail_json": "string",
  • "apply_detail_json": "string",
  • "applied": true,
  • "failure_detail": "string",
  • "creator": {
    },
  • "create_time": 0,
  • "start_time": 0,
  • "finish_time": 0
}

Get semantic-understanding task details

Requires task_manage on the task's Catalog. The input field is returned as an empty string when the caller lacks query_data on the task's Resource, or when the task has no resource_id. Authorization service failures return an error rather than exposing the input. Empty input does not require a query_data check.

Authorizations:
OAuth2
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "scope": "resource",
  • "catalog_id": "string",
  • "catalog_name": "string",
  • "resource_id": "string",
  • "resource_name": "string",
  • "agent_task_id": "string",
  • "agent_id": "string",
  • "input": "string",
  • "input_hash": "string",
  • "status": "pending",
  • "apply_mode": "dry_run",
  • "result_json": "string",
  • "confidence_threshold": 0.1,
  • "confidence": 0.1,
  • "confidence_detail_json": "string",
  • "apply_detail_json": "string",
  • "applied": true,
  • "failure_detail": "string",
  • "creator": {
    },
  • "create_time": 0,
  • "start_time": 0,
  • "finish_time": 0
}

Delete semantic-understanding tasks

The path parameter may contain comma-separated task IDs. Running tasks cannot be deleted.

Authorizations:
OAuth2
path Parameters
id
required
string
query Parameters
ignore_missing
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "error_details": null,
  • "metadata": { }
}