删除已在 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 全局调用。
14 lines
399 B
Python
14 lines
399 B
Python
#!/usr/bin/env python3
|
|
|
|
result = []
|
|
|
|
try:
|
|
dbname = get_module_dbname('pricing')
|
|
async with DBPools().sqlorContext(dbname) as sor:
|
|
rows = await sor.sqlExe("select id, name from pricing_program order by name", {})
|
|
result = [{'value': r['id'], 'text': r['name']} for r in (rows or [])]
|
|
except Exception as e:
|
|
pass
|
|
|
|
return json.dumps(result, ensure_ascii=False, default=str)
|