update
This commit is contained in:
parent
d9fa2c8d6c
commit
748ad49076
@ -1669,6 +1669,7 @@ CREATE TABLE `model_management` (
|
|||||||
`provider` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '厂商名称',
|
`provider` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '厂商名称',
|
||||||
`model_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型标识名',
|
`model_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型标识名',
|
||||||
`display_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '展示名称',
|
`display_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '展示名称',
|
||||||
|
`model_logo` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型logo',
|
||||||
`model_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型类型',
|
`model_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型类型',
|
||||||
`listing_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '上架状态:0待上架 1已上架',
|
`listing_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '上架状态:0待上架 1已上架',
|
||||||
`sort_order` int(11) NOT NULL DEFAULT 0 COMMENT '排序权重,数值越小越靠前',
|
`sort_order` int(11) NOT NULL DEFAULT 0 COMMENT '排序权重,数值越小越靠前',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# model_management 可写入字段(不含 id、created_at、updated_at)
|
# model_management 可写入字段(不含 id、created_at、updated_at)
|
||||||
_MODEL_FIELDS = (
|
_MODEL_FIELDS = (
|
||||||
'llmid', 'provider', 'model_name', 'display_name', 'model_type',
|
'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type',
|
||||||
'context_length', 'input_token_price', 'output_token_price',
|
'context_length', 'input_token_price', 'output_token_price',
|
||||||
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
||||||
'capabilities', 'limitations', 'highlights', 'is_active',
|
'capabilities', 'limitations', 'highlights', 'is_active',
|
||||||
|
|||||||
@ -5,7 +5,7 @@ def _escape(value):
|
|||||||
|
|
||||||
# 客户侧可见字段(不含 listing_status、is_active 等运营字段)
|
# 客户侧可见字段(不含 listing_status、is_active 等运营字段)
|
||||||
_CUSTOMER_MODEL_COLUMNS = """
|
_CUSTOMER_MODEL_COLUMNS = """
|
||||||
id, llmid, provider, model_name, display_name, model_type,
|
id, llmid, provider, model_name, display_name, model_logo, model_type,
|
||||||
context_length, input_token_price, output_token_price,
|
context_length, input_token_price, output_token_price,
|
||||||
cache_hit_input_price, billing_method, billing_unit,
|
cache_hit_input_price, billing_method, billing_unit,
|
||||||
capabilities, limitations, highlights, description, sort_order,is_active, experience
|
capabilities, limitations, highlights, description, sort_order,is_active, experience
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# 可写入/更新的字段(不含 id、created_at、updated_at)
|
# 可写入/更新的字段(不含 id、created_at、updated_at)
|
||||||
_MODEL_FIELDS = (
|
_MODEL_FIELDS = (
|
||||||
'llmid', 'provider', 'model_name', 'display_name', 'model_type',
|
'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type',
|
||||||
'context_length', 'input_token_price', 'output_token_price',
|
'context_length', 'input_token_price', 'output_token_price',
|
||||||
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
||||||
'capabilities', 'limitations', 'highlights', 'is_active',
|
'capabilities', 'limitations', 'highlights', 'is_active',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# model_management 可写入字段(不含 id、created_at、updated_at)
|
# model_management 可写入字段(不含 id、created_at、updated_at)
|
||||||
_MODEL_FIELDS = (
|
_MODEL_FIELDS = (
|
||||||
'llmid', 'provider', 'model_name', 'display_name', 'model_type',
|
'llmid', 'provider', 'model_name', 'display_name', 'model_logo', 'model_type',
|
||||||
'context_length', 'input_token_price', 'output_token_price',
|
'context_length', 'input_token_price', 'output_token_price',
|
||||||
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
'cache_hit_input_price', 'billing_method', 'billing_unit',
|
||||||
'capabilities', 'limitations', 'highlights', 'is_active',
|
'capabilities', 'limitations', 'highlights', 'is_active',
|
||||||
|
|||||||
@ -491,8 +491,8 @@ async def model_usage_admin_report(ns={}):
|
|||||||
if group_by and group_by not in ('hour', 'day', 'week'):
|
if group_by and group_by not in ('hour', 'day', 'week'):
|
||||||
return {'status': False, 'msg': 'group_by 仅支持 hour / day / week'}
|
return {'status': False, 'msg': 'group_by 仅支持 hour / day / week'}
|
||||||
|
|
||||||
page_size = int(ns.get('page_size', 20))
|
page_size = int(ns.get('page_size')) if ns.get('page_size') else 20
|
||||||
current_page = int(ns.get('current_page', 1))
|
current_page = int(ns.get('current_page')) if ns.get('current_page') else 1
|
||||||
offset = (current_page - 1) * page_size
|
offset = (current_page - 1) * page_size
|
||||||
|
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user