bugfix
This commit is contained in:
parent
142dcbb02e
commit
933085b7f3
@ -330,8 +330,19 @@ async def get_llmcatelogs():
|
|||||||
|
|
||||||
return []
|
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'):
|
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()
|
env = ServerEnv()
|
||||||
|
orderby = ['catelog_id', 'providerid', 'name']
|
||||||
async with get_sor_context(env, 'llmage') as sor:
|
async with get_sor_context(env, 'llmage') as sor:
|
||||||
today = curDateString()
|
today = curDateString()
|
||||||
# Join with llm_api_map to get catalog relationship
|
# Join with llm_api_map to get catalog relationship
|
||||||
@ -363,6 +374,7 @@ m.ppid
|
|||||||
cid = ''
|
cid = ''
|
||||||
x = None
|
x = None
|
||||||
for r in recs:
|
for r in recs:
|
||||||
|
await get_pricing_text(r)
|
||||||
if cid != r.catelog_id:
|
if cid != r.catelog_id:
|
||||||
x = {
|
x = {
|
||||||
'catelogid': r.catelog_id,
|
'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:
|
async with get_sor_context(env, 'llmage') as sor:
|
||||||
today = curDateString()
|
today = curDateString()
|
||||||
# Join with llm_api_map to get catalog relationship
|
# 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
|
from llm a
|
||||||
join llm_api_map m on a.id = m.llmid
|
join llm_api_map m on a.id = m.llmid
|
||||||
join llmcatelog b on m.llmcatelogid = b.id
|
join llmcatelog b on m.llmcatelogid = b.id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user