272 Commits

Author SHA1 Message Date
79a99f2dba fix: DataViewer去掉title避免白色背景,修正page_rows参数名 2026-06-13 19:00:40 +08:00
335a06d5ea refactor: failed_accounting.ui改用InlineForm简化过滤栏 2026-06-13 18:41:04 +08:00
a70933c44c fix: dspy添加InlineForm过滤条件支持,UI字段名对齐 2026-06-13 18:27:33 +08:00
7dd0886193 feat: 记账失败页面添加InlineForm过滤栏 2026-06-13 18:24:52 +08:00
3b25b9cfb4 fix: llminference.dspy 增加余额/定价校验拦截
checkCustomerBalance 返回值 f 之前被丢弃,导致即使余额不足或
模型未配置定价,直接调 API 仍可执行推理。

添加 if not f 判断,返回 UiError 拦截。
2026-06-12 16:02:33 +08:00
6bc04897ab bugfix 2026-06-12 15:36:02 +08:00
dd8f2d23f6 chore: untrack .nfs lock file 2026-06-12 15:33:11 +08:00
c90cd88dd4 feat: show_llms_cards_by_provider 添加定价展示 + 优化批量查询
1. get_llms_sort_by_provider: 添加 ppid 批量查询和 pricing_display
2. get_llms_by_catelog: N+1 查询改为批量 ppid 查询,性能优化
3. show_llms_cards_by_provider.ui: 添加 pricing-box 展示区块
4. 两个函数都处理 get_pricing_display 返回 None 的情况
2026-06-12 15:32:34 +08:00
647e63eb04 fix: failed_accounting.ui - Combobox→UiCode, 移除formatter, 修复dspy import 2026-06-12 15:23:05 +08:00
39af416625 fix: 记账失败记录页面的查询和重试按钮
修复 failed_accounting.ui 中两个按钮的 JavaScript 错误:

查询按钮:
- 替换 this.root.getElementById() 为 bricks.getWidgetById()
- 替换 DataViewer.load() 为 render() (正确的公开API)
- 使用 getValue() 获取输入控件值

重试按钮:
- 替换 this.root.getElementById() 为 bricks.getWidgetById()
- 替换 selected_row 为 select_row (正确的内部属性名)
- 通过 .user_data 访问行数据
- 替换 dv.load() 为 dv.render()
- 使用 entire_url() 模板生成正确的 API URL
- 改用 async/await 替代 Promise chain

根本原因: 原代码使用了不存在的 bricks API
(this.root.getElementById, DataViewer.load, selected_row)
2026-06-12 14:28:50 +08:00
34627054b1 feat: code-type fields use fieldname/fieldname_text format
- get_search_providerid.dspy: return {providerid, providerid_text}
- get_search_upappid.dspy: return {upappid, upappid_text}
- get_search_apiname.dspy: return {apiname, apiname_text}
- json/llm.json: add valueField/textField for providerid, upappid
- json/llm_api_map.json: add valueField/textField for apiname, query_apiname

This ensures filter form and add/edit form use the same data format.
2026-06-12 11:40:54 +08:00
8ee2eccc55 feat: add pricing display to model cards
- utils.py: get_llms_by_catelog now queries all distinct ppids for each model
  and calls get_pricing_display to get pricing text
- show_llms_cards.ui: added Filler with pricing-box CSS to display pricing info
- model_plaza.css: added styles for pricing-box and pricing-text (light/dark mode)
2026-06-12 11:28:16 +08:00
2792fc7bda fix: show_llms_cards card overlap - set col_cwidth:25 matching card width, col_cgap:1 for spacing 2026-06-12 11:20:41 +08:00
4d455da18c fix: catelog selection logic and backward compatibility
- utils.py: get_llmage_llm - when catelogid provided, use it instead of forcing isdefaultcatelog=1
- list_paging_catelog_llms.dspy: handle missing llmid in SQL, add llmcatelogid to returned rows
- llm_dialog.ui: use Jinja2 namespace for variable scoping in for loop
2026-06-11 19:29:22 +08:00
52312b0a06 feat: llm_dialog.ui catelog tabs + get_llm_catelogs + inference passes catelogid
- utils.py: get_llmcatelogid -> get_llm_catelogs (returns ALL catelogs with name+isdefault)
- llmclient.py: inference() passes params_kw.llmcatelogid to get_llm()
- llm_dialog.ui: renders catelog tab buttons when model has multiple catelogs,
  defaults to isdefaultcatelog, passes llmcatelogid to both LlmIO models and list_models_url
- init.py: export get_llm_catelogs
2026-06-11 19:22:17 +08:00
982517a1c8 feat: add get_llmcatelogid function and pass llmcatelogid to list_paging_catelog_llms.dspy 2026-06-11 19:02:50 +08:00
767539fabd fix: derive llmcatelogid from llmid when not provided in params 2026-06-11 18:58:33 +08:00
3423d5752f fix: move llmcatelogid filter into subquery (m alias not visible in outer scope) 2026-06-11 18:55:00 +08:00
0f2d84bd00 fix: use m.apiname from llm_api_map instead of a.apiname (column not in llm table) 2026-06-11 17:44:11 +08:00
3947fb3587 refactor: consolidate API docs - wwwroot/api_doc.md symlinked to docs/API.md 2026-06-11 16:08:15 +08:00
242839d0bb docs: add /v1/pricing endpoint to API documentation 2026-06-11 15:20:06 +08:00
4d69d54e20 feat: add /v1/pricing endpoint to get model pricing display info 2026-06-11 15:17:25 +08:00
6fd1f2ee5c bugfix 2026-06-10 16:10:42 +08:00
e29cdadf18 bugfix 2026-06-09 14:01:08 +08:00
f5ded344f6 bugfix 2026-06-09 13:58:03 +08:00
f1d02f9d16 bugfix 2026-06-09 13:55:33 +08:00
dfb0794ee2 bugfix 2026-06-09 13:51:41 +08:00
892f0c5002 bugfix 2026-06-09 13:36:07 +08:00
6123c45c10 bugfix 2026-06-09 11:55:02 +08:00
a1c3eb4b25 feat: apiname/query_apiname改为从uapi动态选择
- 新增 get_search_apiname.dspy: 根据llmid查upappid, 从uapi获取API列表
- apiname: code类型下拉选择(必选)
- query_apiname: code类型下拉选择(可选, 含'不指定'选项)
- 更新 json/llm_api_map.json CRUD定义 alters
- 更新 llm_api_map_manage.ui 表单字段
- 重新生成 wwwroot/llm_api_map/index.ui
- 注册 load_path.py RBAC权限
2026-06-05 18:22:14 +08:00
d4e455ba9a perf: optimize get_inference_history query and add indexes
Query optimization (dspy):
- Replace UNION ALL + sort with two parallel queries (asyncio.gather)
  that each use (userid, use_time) composite index
- Python-side merge-sort of two pre-sorted sequences O(n)
- Concurrent FileStorage reads for ioinfo (asyncio.gather)

Indexes (models/*.json + /tmp/llmage_history_indexes.sql):
- llmusage: add idx_llmusage_userid_usetime (userid, use_time)
- llmusage_history: add idx_lh_userid_usetime (userid, use_time)
  (was missing userid index entirely - main bottleneck)
2026-06-05 17:42:15 +08:00
2ebe811c34 fix: use llm_api_map for llmcatelogid filter (llm table has no catelog column) 2026-06-05 17:38:18 +08:00
6f8c14c329 feat: add llmcatelogid filter and pagerows param to get_inference_history
- Add llmcatelogid parameter to filter by model catalog (joins llm table)
- Change default pagerows from 50 to 10
- Add pagerows parameter for custom page size
2026-06-05 17:34:26 +08:00
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
186f64d544 fix: prepend 全部 option to get_search results 2026-06-04 18:52:10 +08:00
134bd1ca68 fix: replace 'from datetime import date' with pre-loaded curDateString() 2026-06-04 18:39:50 +08:00
9212cf8afb fix: remove import statements from dspy file (violates dspy spec) 2026-06-04 18:35:53 +08:00
faba862336 feat: add check_charging action to test pricing calculation with usage data
- llm_launch_check_api.dspy: add check_charging action
  * Takes usages JSON from inference result
  * Calls env.buffered_charging(ppid, usages) to verify pricing works
  * Returns pricing breakdown with amounts and costs
- llm_launch_check.ui: add '检查计费' button
  * Appears after successful inference
  * Passes usage data to check_charging API
  * Displays pricing calculation results
- llm_launch_check_api.dspy: simplify inference action
  * Direct uapi.call() instead of full inference pipeline
  * Extracts usage from response without writing to database
2026-06-04 18:29:37 +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
308e91c61c fix: align get_search_providerid.dspy with {value, text} format using SQL aliases 2026-06-04 17:58:00 +08:00
9377cfabb8 fix: align get_search_upappid.dspy with {value, text} format 2026-06-04 17:56:34 +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
6bfa0cb27c feat: add llmcatelogid filter param (default t2t) to get_my_asynctasks API 2026-06-04 17:01:29 +08:00
90c93dbe07 feat: get_my_asynctasks 返回记录增加 llmcatelogid 属性
通过 llmid 查询 llm_api_map 表获取对应的 llmcatelogid
2026-06-04 15:12:29 +08:00
ffb10827bb refactor: get_type_llms 参数名 catelogid -> llmcatelogid 2026-06-04 14:36:04 +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
3743dec00d fix: dark mode overrides for plaza sidebar and nav buttons 2026-06-02 21:00:27 +08:00
311b0aec6f bugfix 2026-06-02 13:59:24 +08:00
cab7843f95 bugfix 2026-06-02 13:56:23 +08:00