Download OpenAPI specification:
批量求一批对象实例的工具型逻辑属性(tool)值。
逻辑属性不直接存在于数据源里,需要带参数计算,而参数往往藏在用户的自然语言里
(「最近一年」→ 时间窗、「按省份」→ 分析维度)。本接口先用大模型把 query
翻译成各属性的 dynamic_params,再批量取值,省掉调用方自己拼参数的工作。
对象类有哪些逻辑属性、各自需要什么参数,看
kn-explore.yaml 的 get_object_types 返回的
logic_properties[].parameters。
同一份文件里还有 POST /kn/query_metric:对象指标只支持实例集合,始终按
metric_id 与不可变的对象指标 V1 版本通过该接口取数,不绑定为逻辑属性。
已建模的指标一律不该用 run_sql 重写口径。指标清单来自 get_object_types
返回的 related_metrics。
认证:Authorization: Bearer <token>(OAuth access token 或 bak_ AppKey)。
query 的质量决定成败:参数由大模型从 query(必要时加
additional_context)里推断。查询里要含时间范围、统计维度等业务上下文,
否则会因缺参失败。
缺参返回 400,不是空结果:模型判定必需的 input 参数无法从查询推出时,
返回 400,details 里是 MISSING_INPUT_PARAMS 及逐属性的缺失说明。补上
上下文重试即可。
与之区分的是 500 DYNAMIC_PARAMS_GENERATION_FAILED:那是大模型或依赖服务
故障,不是调用方少给信息,重试或查服务状态。
结果与入参对齐:datas 与 _instance_identities 顺序一一对应,每项含
主键和本次请求的 properties。
| response_format | string Default: "json" Enum: "json" "toon" 响应格式。 |
object (BKNContext) BKN Trace business-provenance context identifying the business
conversation and interaction to which this call belongs. Required on
MCP business tools and REST execution APIs while capture is enabled
and Trace Core is available;
optional on REST reads and Naming it makes the call managed: the service records an Operation under that interaction and attempts to return a receipt and capture evidence. Omitting it entirely, or sending an empty object, makes an eligible REST read or proxy call ad hoc. Only those two shapes are ad hoc — one id without the other, or a misspelt field, is refused rather than quietly downgraded. Both required child fields are server-issued handles and must not be invented by the caller:
These handles are available only through the provenance MCP tool above.
The BKN Trace Core session APIs under | |
| kn_id required | string 知识网络 ID。 |
| ot_id required | string 对象类 ID。 |
| query required | string 用户查询。需要包含时间范围、统计维度、业务上下文,用于生成
|
required | Array of objects 对象实例标识数组,必须从上游取,不可自拼:先调
|
| properties required | Array of strings 要求值的工具型逻辑属性名列表( |
| additional_context | string 补充上下文,如 timezone、instant、step 或对象属性,帮助模型生成更准的
|
| llm_model | string 覆盖用于生成动态参数的大模型;留空走系统默认大模型。 |
object (ResolveOptions) 高级选项。 |
{- "kn_id": "kn_medical",
- "ot_id": "ot_company",
- "query": "计算这些药企的经营健康度",
- "_instance_identities": [
- {
- "company_id": "company_000001"
}, - {
- "company_id": "company_000002"
}
], - "properties": [
- "business_health_score"
]
}{- "datas": [
- { }
], - "debug": {
- "dynamic_params": { },
- "agent_info": { },
- "now_ms": 0,
- "warnings": [
- "string"
], - "trace_id": "string"
}
}按已建模指标自身的口径计算取数,是 OT-first 指标路径的第 3 步:
search_schema / get_kn_detail 锁定对象类 → get_object_types 从
related_metrics 里选定 metric_id 和 version → 本接口计算。
对象指标只支持实例集合,统一走本接口;logic-property-resolver 只负责独立的
工具型逻辑属性。指标参数由调用方显式给出,不经大模型。
version 必填,必须使用已发布、不可变的版本;query 只包含定义允许的
运行时选择(过滤条件、分析维度、毫秒时间范围)。固定口径和统计
粒度由指标定义决定,不能通过本请求覆盖。branch 指定指标所在的知识网络
分支,省略时只读取 main,不会回退到其他分支。
响应保留对象指标 V1 的 model、entries、status 和 warnings。
| response_format | string Default: "json" Enum: "json" "toon" 响应格式。 |
| x-kn-id | string 知识网络 ID 的请求头写法;请求体里给了 |
object (BKNContext) BKN Trace business-provenance context identifying the business
conversation and interaction to which this call belongs. Required on
MCP business tools and REST execution APIs while capture is enabled
and Trace Core is available;
optional on REST reads and Naming it makes the call managed: the service records an Operation under that interaction and attempts to return a receipt and capture evidence. Omitting it entirely, or sending an empty object, makes an eligible REST read or proxy call ad hoc. Only those two shapes are ad hoc — one id without the other, or a misspelt field, is refused rather than quietly downgraded. Both required child fields are server-issued handles and must not be invented by the caller:
These handles are available only through the provenance MCP tool above.
The BKN Trace Core session APIs under | |
| kn_id required | string 知识网络 ID。也可用 |
| branch | string Default: "main" 指标所属知识网络分支;省略时使用 main。 |
| metric_id required | string 指标 ID,取自 |
| version required | integer >= 1 已发布且不可变的对象指标版本,取自 |
object |
{- "kn_id": "kn_supplychain",
- "metric_id": "metric_product_total",
- "version": 1
}{- "kn_id": "string",
- "metric_id": "string",
- "version": 0,
- "model": { },
- "entries": [
- {
- "dimension_cells": [
- {
- "ref": {
- "object_type_id": "string",
- "property_name": "string",
- "relation_path_alias": "string"
}, - "value": null
}
], - "time": 0,
- "time_bucket": {
- "start": 0,
- "end": 0
}, - "value": null,
- "status": "ok",
- "bucket_key": "string",
- "available_actions": [
- "filter"
]
}
], - "is_approximate": true,
- "status": "ok",
- "empty_reason": "filtered_out",
- "total_count": 0,
- "next_cursor": "string",
- "warnings": [
- "string"
], - "overall_ms": 0,
- "evaluated_at": 0,
- "effective_window": {
- "start": 0,
- "end": 0
}
}