- 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
18 lines
510 B
Python
18 lines
510 B
Python
#!/usr/bin/env python3
|
|
import json
|
|
|
|
result = {'success': False, 'data': []}
|
|
|
|
try:
|
|
dbname = get_module_dbname('llmage')
|
|
|
|
async with DBPools().sqlorContext(dbname) as sor:
|
|
rows = await sor.sqlExe("select name, path from uapi order by name", {})
|
|
result['data'] = [{'id': r['name'], 'text': f"{r['name']} ({r['path']})"} for r in (rows or [])]
|
|
result['success'] = True
|
|
|
|
except Exception as e:
|
|
result['error'] = str(e)
|
|
|
|
return json.dumps(result, ensure_ascii=False, default=str)
|