llmage/wwwroot/list_catelog_models.dspy
yumoqing 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

13 lines
393 B
Plaintext

dbname = get_module_dbname('llmage')
db = DBPools()
async with db.sqlorContext(dbname) as sor:
sql = """select * from llm a
join llm_catalog_rel rel on a.id = rel.llmid
where rel.llmcatelogid = ${llmcatelogid}$ and a.id != ${llmid}$"""
ns = params_kw.copy()
recs = await sor.sqlExe(sql, ns)
for r in recs.get('rows', []):
r.description = json.dumps(r.description)
return recs
return []