pipeline-llm/models/llm_call_trace.json
yumoqing 69fe362dde feat(trace): 调用原文追踪「查看IO」前端闭环+按项目费用页(2026-09-10定夺落地)
- json/llm_call_trace_list.json: noedit只读列表;exclouded隐藏id/req_path/resp_path/org_id;
  url/note加宽;kind/method内联枚举(含gen同步生成,此前草稿引用的get_llm_kind_options.dspy不存在);
  删color_mapping(bricks全库0消费的死配置);toolbar查看IO+binds urlwidget→PopupWindow(85%)
  url不带?id=${id}$——生成期ArgsConvert会eval成<built-in function id>垃圾串,
  行数据id经_add_event_data自动并入params(dapi/llmage生产同款)
- api/llm_call_trace_io.dspy: 薄代理(get_user门禁+get_userorgid机构隔离)→env.llm_call_trace_io;
  修草稿4处实锤bug:get_user未await/user.get当dict/sor块外使用/返回PopupWindow套娃
- init.py: llm_call_trace_io读表+同批次+llm_usage上下文(块内读全拷dict)→读文件
  (trace.trace_root realpath前缀校验防穿越)→TabPanel三tab(摘要Html+pre escape防注入/
  请求/响应CodeEditor readonly mode=null);单侧150K截断提示盘上路径;env注册
- api/llm_project_cost_query.dspy: 改{total,rows}契约接Tabular data_url(PageDataLoader);
  wwwroot/llm_project_cost/index.ui: InlineForm(date_from/date_to/status)+Tabular;
  script内getWidgetById起点bricks.app(弹窗DOM挂body下,app.root搜不到)
- card_popup.dspy: titles加llm_call_trace;新增page_targets白名单挂按项目费用页;
  index.ui挂两张卡片(调用原文追踪/按项目费用)
- accounting.py: _maybe_cleanup_traces每日一次接cleanup_expired(trace.py铁律3
  文档承诺worker每日调但循环没接,补齐);放抢锁前(清理幂等多进程同日无害)
- scripts/load_path.py: 注释说明/**通配已覆盖新页面(rbac check_roles_path前缀匹配)
- models/mysql.ddl/README/design-spec: 9张表同步(kind补gen枚举;3.9节;F19/F20)
- scripts/test_llm_call_trace_io.py: stub harness 22断言全过(隔离/穿越/转义/截断/每日门控)
- .gitignore: wwwroot/llm_call_trace/生成目录不入库
2026-09-11 14:58:21 +08:00

112 lines
2.8 KiB
JSON

{
"summary": [
{
"name": "llm_call_trace",
"title": "模型调用原文追踪(上行下行)",
"primary": [
"id"
],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "call_id",
"title": "调用批次ID(与llm_usage.call_id同值,一次chat_inference=N个往返)",
"type": "str",
"length": 32
},
{
"name": "seq",
"title": "往返序号(同步重试0..2;异步提交0,轮询1..N)",
"type": "int",
"default": "0"
},
{
"name": "kind",
"title": "往返类型(chat对话/gen同步生成/submit异步提交/query任务查询)",
"type": "str",
"length": 20
},
{
"name": "url",
"title": "上游URL(去query防签名泄露)",
"type": "str",
"length": 500
},
{
"name": "method",
"title": "HTTP方法",
"type": "str",
"length": 10
},
{
"name": "status_code",
"title": "响应状态码",
"type": "int",
"default": "0"
},
{
"name": "elapsed_ms",
"title": "耗时(毫秒)",
"type": "int",
"default": "0"
},
{
"name": "req_path",
"title": "请求原文文件路径(filesroot相对;headers已脱敏)",
"type": "str",
"length": 300
},
{
"name": "resp_path",
"title": "响应原文文件路径(filesroot相对)",
"type": "str",
"length": 300
},
{
"name": "org_id",
"title": "机构ID(下载端点机构隔离用)",
"type": "str",
"length": 32
},
{
"name": "note",
"title": "错误摘要",
"type": "str",
"length": 200
},
{
"name": "created_at",
"title": "创建时间",
"type": "timestamp",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_llm_call_trace_call",
"idxtype": "index",
"idxfields": [
"call_id"
]
},
{
"name": "idx_llm_call_trace_org",
"idxtype": "index",
"idxfields": [
"org_id",
"created_at"
]
}
],
"codes": []
}