518 Commits

Author SHA1 Message Date
21df5fdc80 bugfix 2026-05-21 16:50:55 +08:00
9b7f0e79fc bugfix 2026-05-21 16:35:50 +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
f1498178cc fix(llm_api_map_manage): 修正uitype规范+VScrollPanel滚动+llmid隐藏字段
- select→code, text→str, number→int 对齐bricks uitype规范
- 表单区域父容器改用VScrollPanel(height:500px)防止超出屏幕
- llmid改为uitype:hidden, 从params_kw.llmid获取值(从llm CRUD tool触发)
- 移除llmid的select下拉和label
2026-05-21 16:11:40 +08:00
ca21d5cf25 bugfix 2026-05-21 15:53:53 +08:00
9f4a64b6af fix: llm.json subtable add url pointing to llm_api_map_manage.ui (avoid unregistered /llmage/llm_api_map path) 2026-05-21 15:12:27 +08:00
71d366f73d bugfix 2026-05-21 13:59:21 +08:00
abafdb4eb9 bugfix 2026-05-21 13:35:00 +08:00
6031efaa67 bugfix 2026-05-21 13:33:32 +08:00
449e9db1f4 bugfix 2026-05-21 13:25:20 +08:00
76622381be bugfix 2026-05-21 13:19:48 +08:00
81bed1d384 feat: add json table definitions for all models (converted from xlsx) 2026-05-21 12:46:20 +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
1060cac2de feat: llm_api_map CRUD management and ownerid-based data isolation
- Update json/llm.json subtable from llm_catelog_rel to llm_api_map
- Rewrite json/llm_api_map.json as standard CRUD format (tblname+params)
- Add models/llm_api_map.json table definition (summary/fields/indexes/codes)
- Add independent management UI (llm_api_map_manage.ui)
- Add CRUD DSPY APIs (list/create/delete/options) with ownerid filtering
- All operations verify l.ownerid for data isolation
- Add uapi_options.dspy for API selection dropdown
2026-05-20 17:29:27 +08:00
70e8fd791f fix: remove duplicate m.query_apiname from get_llm SQL (a.* already contains it) 2026-05-20 16:55:24 +08:00
334dcc5947 fix: update llm_api_map field lengths to 32 (getID() standard) 2026-05-20 16:41:28 +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
f9a7293c46 bugfix 2026-05-19 21:27:46 +08:00
37ef130591 bugfix 2026-05-19 21:22:52 +08:00
e7ca580a1c bugfix 2026-05-19 21:21:22 +08:00
7679047bc4 bugfix 2026-05-19 21:19:28 +08:00
2562ddf5b0 bugfix 2026-05-19 21:14:47 +08:00
b93106305f bugfix 2026-05-19 17:42:45 +08:00
3f57ce2c21 bugfix 2026-05-19 17:31:39 +08:00
2ff084ac3b bugfix 2026-05-19 17:26:56 +08:00
f3e6e3152d bugfix 2026-05-19 16:56:30 +08:00
7729d05bbf bugfix 2026-05-19 16:21:23 +08:00
fc2e5c066e bugfix 2026-05-19 16:12:54 +08:00
c89de384b5 bugfix 2026-05-19 16:11:16 +08:00
b60c24c9f6 bugfix 2026-05-19 16:08:34 +08:00
7c7db5bd67 bugfix 2026-05-19 15:56:35 +08:00
28a9cb52ae bugfix 2026-05-19 15:32:43 +08:00
3ddf1a545d bugfix 2026-05-19 15:32:16 +08:00
3fea75395b bugfix 2026-05-18 16:02:31 +08:00
efee227cf1 feat: add catalog relation management entry in menu
- Add 类型关联 menu item pointing to llm_catalog_rel_manage.ui
- Allows managing LLM to catalog (type) relations from menu
2026-05-17 01:08:32 +08:00
1b74b5bf10 feat: add llm catalog (type) management module
- Add CRUD API for llmcatelog (list/create/update/delete)
- Add llmcatelog.ui as main entry for catalog management
- Add llmcatelog_list.ui as DataViewer interface
- Add index.ui as module navigation page
- Update json/llmcatelog.json with editable section
2026-05-17 00:46:31 +08:00
4280459fc4 refactor: remove add_cleanupctx for multi-process compatibility
- Extracted backend_accounting to independent process in sage/bin/
- Removed add_cleanupctx(start_backend) from load_llmage()
- Prevents duplicate billing loops in multi-worker Sage deployments

Related: sage repo feat/multi-process-scaling branch
2026-05-17 00:06:34 +08:00
6cc3986a2d feat: support multi-catalog for LLMs
- Create llm_catalog_rel model for one-to-many relationship
- Remove llmcatelogid from llm model
- Update SQL queries in utils.py and dspy files to use join
- Add maintenance UI (llm_catalog_rel_manage.ui) and API endpoints
- Filter options by user's orgid
2026-05-16 21:31:19 +08:00
6a33c5e9aa bugfix 2026-05-16 15:14:31 +08:00
be7317eeb8 bugfix 2026-05-16 10:15:11 +08:00
623644b633 bugfix 2026-05-15 13:23:10 +08:00
4c827cd5d0 bugfix 2026-05-14 15:19:13 +08:00
034e7a072f bugfix 2026-05-14 15:08:37 +08:00
b31350b2c1 bugfix 2026-05-14 15:07:13 +08:00
51eee49c10 bugfix 2026-05-14 15:00:24 +08:00
d8146ef2eb bugfix 2026-05-14 11:53:16 +08:00
a5c459599a bugfix 2026-05-08 11:02:00 +08:00
6afbc71b13 bugfix 2026-05-08 10:54:33 +08:00