bugfix
This commit is contained in:
parent
142dcbb02e
commit
933085b7f3
@ -330,8 +330,19 @@ async def get_llmcatelogs():
|
||||
|
||||
return []
|
||||
|
||||
async def get_pricing_text(l):
|
||||
try:
|
||||
pd = await env.get_pricing_display(l.ppid, model=l.name)
|
||||
if pd:
|
||||
llm.pricing_display = pd.get('display_text', '')
|
||||
except:
|
||||
pass
|
||||
|
||||
async def get_llms_by_catelog_to_customer(catelogid=None, orderby='providerid'):
|
||||
# icon "{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
||||
# pricing: llm.pricing_display
|
||||
env = ServerEnv()
|
||||
orderby = ['catelog_id', 'providerid', 'name']
|
||||
async with get_sor_context(env, 'llmage') as sor:
|
||||
today = curDateString()
|
||||
# Join with llm_api_map to get catalog relationship
|
||||
@ -363,6 +374,7 @@ m.ppid
|
||||
cid = ''
|
||||
x = None
|
||||
for r in recs:
|
||||
await get_pricing_text(r)
|
||||
if cid != r.catelog_id:
|
||||
x = {
|
||||
'catelogid': r.catelog_id,
|
||||
@ -381,7 +393,7 @@ async def get_llms_by_catelog(catelogid=None, orderby='providerid'):
|
||||
async with get_sor_context(env, 'llmage') as sor:
|
||||
today = curDateString()
|
||||
# Join with llm_api_map to get catalog relationship
|
||||
sql = """select distinct a.*, b.name as catelogname, m.llmcatelogid as catelog_id
|
||||
sql = """select distinct a.*, b.name as catelogname, m.llmcatelogid as catelog_id
|
||||
from llm a
|
||||
join llm_api_map m on a.id = m.llmid
|
||||
join llmcatelog b on m.llmcatelogid = b.id
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user