- 将llmusage_ioinfo_display.ui和llmusage_usages_display.ui从Jinja模板改为.dspy脚本 - 在utils.py中添加get_llmusage_by_id和read_ioinfo_content两个函数 - 重写get_llmusage.dspy,避免sqlPaging子查询包装,分离count和data查询 - 为llmusage表添加use_time索引提升排序性能 - 更新load_path.py和json/llmusage.json引用新的.dspy文件
203 lines
4.6 KiB
JSON
203 lines
4.6 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "llmusage",
|
|
"title": "模型使用",
|
|
"primary": [
|
|
"id"
|
|
],
|
|
"catelog": "entity"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "id",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "llmid",
|
|
"title": "model",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "use_date",
|
|
"title": "使用日期",
|
|
"type": "date"
|
|
},
|
|
{
|
|
"name": "use_time",
|
|
"title": "使用时间",
|
|
"type": "timestamp"
|
|
},
|
|
{
|
|
"name": "userid",
|
|
"title": "username",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "usages",
|
|
"title": "使用信息",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"name": "ioinfo",
|
|
"title": "交互内容",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"name": "transno",
|
|
"title": "交易号",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "responsed_seconds",
|
|
"title": "响应时间",
|
|
"type": "float",
|
|
"length": 18,
|
|
"dec": 2
|
|
},
|
|
{
|
|
"name": "finish_seconds",
|
|
"title": "结束时间",
|
|
"type": "float",
|
|
"length": 18,
|
|
"dec": 2
|
|
},
|
|
{
|
|
"name": "status",
|
|
"title": "状态",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "taskid",
|
|
"title": "任务号",
|
|
"type": "str",
|
|
"length": 256
|
|
},
|
|
{
|
|
"name": "amount",
|
|
"title": "交易金额",
|
|
"type": "float",
|
|
"length": 18,
|
|
"dec": 2
|
|
},
|
|
{
|
|
"name": "cost",
|
|
"title": "交易成本",
|
|
"type": "float",
|
|
"length": 18,
|
|
"dec": 2
|
|
},
|
|
{
|
|
"name": "userorgid",
|
|
"title": "user_orgname",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "ownerid",
|
|
"title": "owner_orgname",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "accounting_status",
|
|
"title": "记账状态",
|
|
"type": "str",
|
|
"length": 32
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx1",
|
|
"idxtype": "unique",
|
|
"idxfields": [
|
|
"taskid"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx2",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"userid"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_llmusage_accounting",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"accounting_status",
|
|
"use_date"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_llmusage_userid_usetime",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"userid",
|
|
"use_time"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_llmusage_userorgid_usetime",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"userorgid",
|
|
"use_time"
|
|
]
|
|
},
|
|
{
|
|
"name": "idx_llmusage_usetime",
|
|
"idxtype": "index",
|
|
"idxfields": [
|
|
"use_time"
|
|
]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "userid",
|
|
"table": "users",
|
|
"valuefield": "id",
|
|
"textfield": "username"
|
|
},
|
|
{
|
|
"field": "ownerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "userorgid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "llmid",
|
|
"table": "llm",
|
|
"valuefield": "id",
|
|
"textfield": "model"
|
|
},
|
|
{
|
|
"field": "status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='llmusage_status'"
|
|
},
|
|
{
|
|
"field": "accounting_status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='accounting_status'"
|
|
}
|
|
]
|
|
} |