- dm_model_call_fact 增加 amount_cny 字段(CNY折算金额) - ETL sync_call_fact 同步时计算并写入 amount_cny - dm_model_perf_daily/dm_provider_cost_daily 唯一键加入 currency(按币种分组) - ETL 聚合函数按 currency 分组,保留原币种维度 - Dashboard 查询统一使用 amount_cny 进行跨币种比较 - 汇率查询从 accounting 模块获取(修正库名) - 新增币种分布统计接口和UI展示
228 lines
5.3 KiB
JSON
228 lines
5.3 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "dm_model_call_fact",
|
|
"title": "LLM调用明细事实表",
|
|
"primary": ["id"],
|
|
"catelog": "fact"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "主键ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "luid",
|
|
"title": "LLM使用记录ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "llmid",
|
|
"title": "LLM模型ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "model",
|
|
"title": "模型名称",
|
|
"type": "str",
|
|
"length": 100
|
|
},
|
|
{
|
|
"name": "catelogid",
|
|
"title": "目录ID",
|
|
"type": "str",
|
|
"length": 10
|
|
},
|
|
{
|
|
"name": "userid",
|
|
"title": "用户ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "userorgid",
|
|
"title": "用户机构ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "ownerid",
|
|
"title": "所有者ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "providerid",
|
|
"title": "供应商ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "call_date",
|
|
"title": "调用日期",
|
|
"type": "date",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "call_hour",
|
|
"title": "调用小时",
|
|
"type": "int",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "call_time",
|
|
"title": "调用时间",
|
|
"type": "datetime",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "ttft_ms",
|
|
"title": "首Token响应时间(毫秒)",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"name": "ttot_ms",
|
|
"title": "总响应时间(毫秒)",
|
|
"type": "int"
|
|
},
|
|
{
|
|
"name": "prompt_tokens",
|
|
"title": "提示Token数",
|
|
"type": "int",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "completion_tokens",
|
|
"title": "完成Token数",
|
|
"type": "int",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"title": "状态",
|
|
"type": "str",
|
|
"length": 20
|
|
},
|
|
{
|
|
"name": "fail_reason",
|
|
"title": "失败原因",
|
|
"type": "str",
|
|
"length": 200
|
|
},
|
|
{
|
|
"name": "amount",
|
|
"title": "金额(原币)",
|
|
"type": "double",
|
|
"length": 10,
|
|
"dec": 4,
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"title": "货币",
|
|
"type": "str",
|
|
"length": 5,
|
|
"default": "CNY"
|
|
},
|
|
{
|
|
"name": "amount_cny",
|
|
"title": "金额(CNY)",
|
|
"type": "double",
|
|
"length": 10,
|
|
"dec": 4,
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "distributor_orgid",
|
|
"title": "分销商机构ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "sale_userid",
|
|
"title": "销售用户ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "创建时间",
|
|
"type": "timestamp"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_call_date",
|
|
"idxtype": "index",
|
|
"idxfields": ["call_date"]
|
|
},
|
|
{
|
|
"name": "idx_llmid",
|
|
"idxtype": "index",
|
|
"idxfields": ["llmid"]
|
|
},
|
|
{
|
|
"name": "idx_userorgid",
|
|
"idxtype": "index",
|
|
"idxfields": ["userorgid"]
|
|
},
|
|
{
|
|
"name": "idx_ownerid",
|
|
"idxtype": "index",
|
|
"idxfields": ["ownerid"]
|
|
},
|
|
{
|
|
"name": "idx_status",
|
|
"idxtype": "index",
|
|
"idxfields": ["status"]
|
|
},
|
|
{
|
|
"name": "idx_model",
|
|
"idxtype": "index",
|
|
"idxfields": ["model"]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "llmid",
|
|
"table": "llm",
|
|
"valuefield": "id",
|
|
"textfield": "model"
|
|
},
|
|
{
|
|
"field": "userid",
|
|
"table": "users",
|
|
"valuefield": "id",
|
|
"textfield": "username"
|
|
},
|
|
{
|
|
"field": "userorgid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "ownerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "providerid",
|
|
"table": "llmprovider",
|
|
"valuefield": "id",
|
|
"textfield": "name"
|
|
}
|
|
]
|
|
}
|