21 Commits

Author SHA1 Message Date
1d12d42e80 feat: add get_inference_history API - cross-table paginated query with ioinfo content
- UNION ALL query from llmusage + llmusage_history tables
- Filter by current user's userid, sorted by use_time desc
- 50 records per page with pagination support
- Reads ioinfo webpath via FileStorage to return actual input/output content
- Registered in load_path.py for RBAC (logined role)
2026-06-05 17:15:05 +08:00
3a0a8d4c86 feat: 添加模型上线检查功能
- 新增 llm_launch_check_api.dspy:执行完整的上线前检查
  * 检查模型记录、日期、状态
  * 检查上位系统(upapp)关联
  * 检查API映射(uapi)
  * 检查IO定义(uapiio)
  * 检查能力映射(llm_api_map)
  * 检查定价项目(pricing_program)
  * 检查定价数据(pricingdata)
  * 支持体验测试(action=inference)
- 新增 llm_launch_check.ui:检查结果展示界面
- 修改 llm.json:将'体验'按钮改为'上线检查'
- 更新 load_path.py:注册新路径
2026-06-04 18:11:12 +08:00
bb4900f997 feat: add get_search_{fieldname}.dspy for codes fields with 全部 option
- get_search_providerid.dspy: organization list with 全部 as first entry
- get_search_upappid.dspy: upapp list with 全部 as first entry
- json/llm.json: update alters dataurl to use search scripts
- load_path.py: register new RBAC paths
2026-06-04 17:22:50 +08:00
df8aafe1d8 feat: add TTS and ASR audio API endpoints
- POST /v1/audio/speech (TTS): MiniMax Speech 2.6 Turbo/HD, 2.5 HD, F5-TTS local
- POST /v1/audio/transcriptions (ASR): qwen3-asr-flash, Nvidia parakeet
- Add comprehensive docs for both endpoints in API.md
- Update load_path.py RBAC (logined + customer roles)
2026-06-04 13:58:26 +08:00
ae02a7e88c feat: add music generation API (MiniMax Music 2.5/2.6)
- Add POST /v1/music/generations endpoint (index.dspy)
- Add music generation section to API docs
- Update load_path.py RBAC permissions for new path
- Models: music-2.6, music-2.5 (MiniMax, sync, returns audio URL)
- Required params: model, catelogid=music_gen, prompt, lyrics
2026-06-04 13:40:08 +08:00
fb7fa8c082 fix: replace wildcard patterns with explicit per-file entries in load_path.py 2026-06-04 13:03:31 +08:00
dc007a30a9 feat: 模型广场页面 - 新增 model_plaza.ui (TabPanel按分类/按供应商) - 新增 model_plaza.css (卡片悬浮效果/间距优化) - show_llms/show_llms_by_providers 添加 plaza-card/plaza-grid CSS - load_path.py 注册权限 2026-05-31 11:08:10 +08:00
ce5cfc4463 feat: add customer role RBAC permissions for v1 API endpoints
Grant customer.admin and customer.user roles access to llmage v1 API:
- /v1/chat/completions
- /v1/video/generations
- /v1/image/generations
- /v1/models
- /v1/tasks

Updated both load_path.py and setup_llmage_perms.sh
2026-05-31 09:05:07 +08:00
022269040f feat: load_path添加api_doc.ui和api_doc.md权限路径 2026-05-31 09:03:17 +08:00
5ec5946a90 fix: derive sage_root from script location instead of hardcoded path 2026-05-30 13:41:01 +08:00
e494c88977 fix: migrate_llmcatelog_ids script missing database config init
DBPools() was called without config.databases, causing NoneType error.
Load config from sage_root and pass config.databases like the other
migration script does.
2026-05-30 13:30:50 +08:00
3ba1c50eb6 feat: add llmcatelog ID migration script (random IDs to meaningful abbreviations) 2026-05-30 12:07:19 +08:00
c65cf35a85 refactor: use wildcard % in load_path.py for auto-coverage 2026-05-29 00:52:19 +08:00
a4e3411584 feat: add scripts/load_path.py for RBAC permission management
- Migrate all llmage permission entries from sage/load_path.py
- Include new data_filter API endpoints (llm_list/create/update/delete, get_organizations, get_upapps)
- Include all existing v1, api, CRUD directory, and page endpoints
- Follow product_management/scripts/load_path.py pattern
2026-05-26 14:32:44 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +08:00
07b4893252 feat(llmage): 添加llmusage历史记录备份和记账失败检索功能
- 新增 llmusage_history 表:定时备份已记账(use_date<today)的历史记录
- 新增 llmusage_accounting_failed 表:记录记账失败详情,支持检索
- 新增 backup_accounted_llmusage() 函数:备份+清理历史数据
- 新增 get_failed_accounting_records() 函数:按条件检索失败记录
- 更新 llm_accoung_failed():同时写入失败表记录
- 新增 failed_accounting.ui 页面和 failed_accounting_list.dspy API
- 新增 llmusage CRUD API (create/update/delete)
- 新增表索引优化查询性能
- 更新 setup_llmage_perms.sh 添加新端点权限
- 生成生产迁移SQL: scripts/migrate_llmusage_history.sql
2026-05-24 13:55:48 +08:00
5b3c7d4d02 refactor: 废弃llm_catalog_rel表, 分类关系改用llm_api_map
- 删除 llm_catalog_rel 表定义(models/json/xlsx)、CRUD文件、管理页面、迁移脚本
- utils.py: get_llms_by_catelog/get_llms_by_catelog_to_customer 的SQL从 llm_catalog_rel 改为 llm_api_map (加distinct去重)
- init.py: 缓存清除事件从 llm_catalog_rel 改为 llm_api_map
- menu.ui/index.ui: 移除类型关联菜单项
- dspy文件: v1/chat/completions, t2t, get_type_llms, list_catelog_models, list_paging_catelog_llms, llmcatelog_delete 全部改为 join llm_api_map
- 迁移脚本: 添加try/except兼容旧表不存在的情况
2026-05-21 16:22:59 +08:00
17f6855b5a feat: add deployment scripts for llm_api_map migration
- scripts/migrate_llm_api_map_db.py: Direct DB migration (create table + migrate data)
  Supports --dry-run and --drop-old flags
- scripts/deploy_llmage.sh: One-click deployment script
  Orchestrates: git pull -> build -> migrate -> perms -> restart
2026-05-21 10:59:15 +08:00
6f851895fe feat: add permissions script for llm_api_map management (Admin + Operator level)
- scripts/setup_llmage_perms.sh: shell-based permission init following sage convention
- Replaces deleted Python/SQL permission scripts
- Authorizes: owner.superuser, *.admin roles, reseller.operator
- Covers: llm_api_map_manage.ui + all CRUD API endpoints + uapi_options
2026-05-20 18:01:53 +08:00
715e759be9 feat: add permission scripts for llm_api_map endpoints
- scripts/add_llm_api_map_perms.sql: SQL to insert permission records
- scripts/add_llm_api_map_perms.py: Python script using getID() for ID generation
- Covers all new llm_api_map CRUD endpoints and uapi_options
2026-05-20 17:36:09 +08:00
d2ffd9c6d0 refactor: introduce llm_api_map table and remove uapiset intermediate layer
- New llm_api_map table: extract ability-specific fields (apiname,
  query_apiname, query_period, ppid) from llm table to support
  one-model-multi-ability without redundancy
- Remove uapiset from llmage JOIN chain: upapp.apisetid now directly
  joins uapi.apisetid
- Updated BufferedLLMs.get_llm() to JOIN llm_api_map for
  query_apiname/query_period/ppid fields
- Updated llmcheck.dspy and list_paging_catelog_llms.dspy to remove
  uapiset references
- Added migration script to generate llm_api_map INSERTs from existing
  llm data
2026-05-20 15:13:07 +08:00