11 Commits

Author SHA1 Message Date
287e6c5a40 fix: 修复6个v1 DSPY缓存替换造成的缩进错误 2026-07-24 16:56:50 +08:00
ad5d8c00c5 perf: 18个v1 DSPY全改用llmid缓存,去3表JOIN+DB连接 2026-07-24 11:01:40 +08:00
27f3ee9c78 feat: llm.name唯一索引; v1端点全部改用name查找llm 2026-07-01 13:48:05 +08:00
6890af7638 fix: 清理所有 dspy 文件的 import 语句
删除已在 ahserver/ServerEnv 预加载的模块:
  json, datetime, getID, debug, curDateString, timestampstr,
  get_sor_context, time, DictObject, partial, FileStorage, os

删除模块内部 import:
  from llmage.utils import get_llmusage_by_id, read_ioinfo_content

同步将 get_llmusage_by_id, read_ioinfo_content 加入 load_llmage() 导出,
dspy 中通过 ServerEnv 全局调用。
2026-06-30 17:38:37 +08:00
59587a8c31 bugfix 2026-06-30 16:10:20 +08:00
dd78e647da bugfix 2026-06-30 15:56:47 +08:00
5d52d02319 refactor: V1 API 支持新 catelogid 缩写(t2t/t2v/t2i等),向后兼容中文名
- v1/chat/completions: 默认值 '文生文' → 't2t',SQL 匹配 b.id OR b.name
- v1/video/generations: SQL 匹配 b.id OR b.name,注释示例更新
- v1/image/generations: SQL 匹配 b.id OR b.name,注释示例更新
- t2t/index.dspy: 默认值 '文生文' → 't2t',SQL 匹配 b.id OR b.name
- get_type_llms.dspy: 硬编码中文名改为 alias 映射(t2v/i2v/r2v)
- docs/API.md: 添加完整 catelogid ID 对照表,示例参数更新
2026-05-30 20:36:16 +08:00
08bebcd257 refactor: v1 API 统一使用 catelogid 参数替代 lctype/llmcatelogid 2026-05-30 16:22:21 +08:00
44d94dace5 refactor: optimize debug output - use debug_params for compact logging, truncate SQL; add CRUD definitions 2026-05-29 12:07:53 +08:00
d6e4221a7b feat: add model publish/unpublish (上架/下架) functionality
- llm table: add status field (published/unpublished, default unpublished)
- User-facing queries: filter by status='published' in 11 query points:
  - utils.py: get_llms_by_catelog_to_customer, get_llms_by_catelog,
    get_llm, get_llmproviders, get_llms_sort_by_provider
  - v1 endpoints: chat/completions, image/generations, video/generations
  - user pages: t2t, get_type_llms, list_catelog_models,
    list_paging_catelog_llms, llmcheck
- CRUD: status column visible/editable with select dropdown
- Admin CRUD list shows ALL models regardless of status
- Migration SQL: sql/add_status_field.sql (existing models set to published)
2026-05-28 23:42:29 +08:00
146ebb2b4a feat: add /v1/video/generations and /v1/image/generations API endpoints
- wwwroot/v1/video/generations/index.dspy: video generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports async task submission via existing inference infrastructure

- wwwroot/v1/image/generations/index.dspy: image generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports both sync and async models depending on config

Both endpoints follow the same pattern as /v1/chat/completions:
  1. Validate required params (model + llmcatelogid + prompt)
  2. Look up llm via llm_api_map join with catalog type
  3. Check customer balance
  4. Route to inference (async/sync based on model config)
2026-05-26 11:45:37 +08:00