- utils.py: get_llms_by_catelog now queries all distinct ppids for each model and calls get_pricing_display to get pricing text - show_llms_cards.ui: added Filler with pricing-box CSS to display pricing info - model_plaza.css: added styles for pricing-box and pricing-text (light/dark mode)
113 lines
2.3 KiB
XML
113 lines
2.3 KiB
XML
{% set catelogid = params_kw.get('catelogid', None) %}
|
|
{% set data = get_llms_by_catelog(catelogid=catelogid) %}
|
|
{% set ns = namespace(first=true) %}
|
|
{
|
|
"widgettype":"VScrollPanel",
|
|
"options":{
|
|
"css":"filler",
|
|
"width":"100%",
|
|
"height":"100%"
|
|
},
|
|
"subwidgets":[
|
|
{
|
|
"widgettype":"DynamicColumn",
|
|
"options":{
|
|
"css":"plaza-grid",
|
|
"width":"100%",
|
|
"col_cwidth":25,
|
|
"col_cgap":1
|
|
},
|
|
"subwidgets":[
|
|
{% for cate in data %}
|
|
{% for llm in cate.llms %}
|
|
{% if not ns.first %},{% endif %}
|
|
{
|
|
"widgettype":"VScrollPanel",
|
|
"options":{
|
|
"css":"card plaza-card",
|
|
"cwidth":25,
|
|
"cheight":16
|
|
},
|
|
"subwidgets":[
|
|
{
|
|
"widgettype":"HBox",
|
|
"options":{
|
|
"cheight":2
|
|
},
|
|
"subwidgets":[
|
|
{
|
|
"widgettype":"Svg",
|
|
"options":{
|
|
"rate":1.5,
|
|
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
|
}
|
|
},
|
|
{
|
|
"widgettype":"Title6",
|
|
"options":{
|
|
"text":"{{llm.name}}"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype":"Text",
|
|
"options":{
|
|
"text":{{json.dumps(llm.description, ensure_ascii=False)}},
|
|
"wrap":true,
|
|
"halign":"left"
|
|
}
|
|
},
|
|
{
|
|
"widgettype":"Filler",
|
|
"options":{
|
|
"css":"pricing-box"
|
|
},
|
|
"subwidgets":[
|
|
{% for pricing_text in llm.pricing_display %}
|
|
{
|
|
"widgettype":"Text",
|
|
"options":{
|
|
"text":{{json.dumps(pricing_text, ensure_ascii=False)}},
|
|
"wrap":true,
|
|
"halign":"left",
|
|
"css":"pricing-text"
|
|
}
|
|
}{% if not loop.last %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
],
|
|
"binds":[
|
|
{
|
|
"wid":"self",
|
|
"event":"click",
|
|
"actiontype":"urlwidget",
|
|
"target":"PopupWindow",
|
|
"popup_options":{
|
|
"title":"{{llm.name}}",
|
|
{% if int(params_kw._is_mobile) %}
|
|
"width": "100%",
|
|
"height": "100%"
|
|
{% else %}
|
|
"width": "40%",
|
|
"height":"85%"
|
|
{% endif %}
|
|
},
|
|
"options":{
|
|
"params":{
|
|
"id":"{{llm.id}}"
|
|
},
|
|
"url":"{{entire_url('./llm_dialog.ui')}}"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
{% set ns.first = false %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
]
|
|
}
|