LingxiGraph
API 参考

Graph 与 Assistant API

发现受信图版本,并创建可调用 Assistant

Graph

Graph 由部署清单注册,只读且由 (id, version) 唯一标识。

GET /v1/graphs
GET /v1/graphs/{graph_id}?graph_version=1.0.0
GET /v1/graphs/{graph_id}/structure?graph_version=1.0.0&xray=true

GraphInfo 字段:

字段类型说明
idversionstring稳定图 ID 与部署版本
schema_hashstring编译 schema/计划 hash
input_schemaoutput_schemaobjectJSON Schema
context_schemaobject/nullcontext JSON Schema

structure 返回节点、边、debug metadata 和 Mermaid;xray=true 递归展开子图。

创建 Assistant

curl -X POST https://agents.example.com/v1/assistants \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "graph_id": "production-support",
    "graph_version": "1.0.0",
    "name": "support-prod",
    "config": {"recursion_limit": 32},
    "context": {"region": "cn"},
    "metadata": {"owner": "support-platform"}
  }'
请求字段必填说明
graph_id已注册图 ID
graph_version省略时使用 registry 默认版本
name人类可读名称
config默认运行配置
context默认、经 schema 校验的上下文
metadata平台检索/治理元数据

管理 Assistant

GET    /v1/assistants
GET    /v1/assistants/{assistant_id}
PATCH  /v1/assistants/{assistant_id}
DELETE /v1/assistants/{assistant_id}

PATCH 可包含 nameconfigcontextmetadata。不能通过 PATCH 更换 graph;需要新图版本时创建新 Assistant 或使用部署策略切换默认版本。

Run 创建时会复制 Assistant 的 graph ID/version/config/context。之后修改 Assistant 不会改变已经排队、运行或暂停的 run。

On this page