- 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
13 lines
393 B
Plaintext
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 []
|