diff --git a/llmage/init.py b/llmage/init.py index 0e0637d..93487c6 100644 --- a/llmage/init.py +++ b/llmage/init.py @@ -12,7 +12,6 @@ from .utils import ( get_llm_by_model, get_llms_by_catelog, get_llms_sort_by_provider, - get_llmage_llm, get_llmcatelogs, get_llms_by_catelog_to_customer, get_llmproviders, @@ -46,7 +45,6 @@ def load_llmage(): env = ServerEnv() env.llm_query_orders = llm_query_orders env.read_webpath = read_webpath - env.get_llmage_llm = get_llmage_llm env.get_llm_by_model = get_llm_by_model env.llm_charging = llm_charging env.get_accounting_llmusages = get_accounting_llmusages diff --git a/llmage/utils.py b/llmage/utils.py index 85b59da..beb29c4 100644 --- a/llmage/utils.py +++ b/llmage/utils.py @@ -313,38 +313,6 @@ async def get_llms_by_catelog(catelogid=None, orderby='providerid'): return d return [] -async def get_llmage_llm(llmid, catelogid=None): - sql = """select distinct a.*, -m.llmcatelogid, -m.apiname, -m.query_apiname, -m.query_period, -m.ppid from llm a - join llm_api_map m on a.id = m.llmid - join llmcatelog b on m.llmcatelogid = b.id - where b.id = m.llmcatelogid - and a.model=${model}$ - and a.expired_date > ${today}$ - and a.enabled_date <= ${today}$ - and a.status = 'published'""" - env = ServerEnv() - async with get_sor_context(env, 'llmage') as sor: - ns = {'llmid': llmid, 'today': today} - if catelogid: - sql += ' and m.llmcatelogid = ${catelogid}$ ' - ns['catelogid'] = catelogid - else: - sql += " and m.isdefaultcatelog = '1'" - recs = await sor.sqlExe(sql, ns.copy()) - if len(recs) > 0: - r = recs[0] - return r - else: - debug(f'{llmid=} not found, {ns=}, {sql=}') - return None - exception(f'Error: {format_exc()}') - return None - async def get_llm(llmid, catelogid=None): today = curDateString() env = ServerEnv()