71 lines
1.4 KiB
XML
71 lines
1.4 KiB
XML
{% if get_user() %}
|
||
{% set userorgid = get_userorgid() %}
|
||
{% if params_kw.id %}
|
||
{% if checkCustomerBalance(params_kw.id, userorgid) %}
|
||
{% set llm = get_llm(params_kw.id) %}
|
||
{% set kdbs = get_user_kdbs(request) %}
|
||
{% if llm %}
|
||
{
|
||
"widgettype":"LlmIO",
|
||
"options":{
|
||
"width":"100%",
|
||
"height":"100%",
|
||
"title":"{{llm.name}}",
|
||
{% if len(kdbs) > 0 %}
|
||
"enabled_kdb": true,
|
||
"kdb_setting":{},
|
||
"get_kdb_url": "{{entire_url('/rag/get_my_kdbs.dspy')}}",
|
||
{% endif %}
|
||
"list_models_url":"{{entire_url('list_paging_catelog_llms.dspy')}}",
|
||
"estimate_url":"{{entire_url('model_estimate.dspy')}}",
|
||
"input_fields":{{llm.input_fields}},
|
||
"models":[
|
||
{
|
||
"llmid":"{{llm.id}}",
|
||
"llmcatelogid":"{{llm.llmcatelogid}}",
|
||
"response_mode": "{{llm.stream}}",
|
||
"icon":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}",
|
||
"url":"{{entire_url('/llmage/llminference.dspy')}}",
|
||
"model":"{{llm.model}}",
|
||
"modelname":"{{llm.name}}"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
{% else %}
|
||
{
|
||
"widgettype":"Text",
|
||
"options":{
|
||
"otext": "没找到模型",
|
||
"i18n":true
|
||
}
|
||
}
|
||
{% endif %}
|
||
{% else %}
|
||
{
|
||
"widgettype":"Text",
|
||
"options":{
|
||
"otext":"Not enrogh balance to use llm",
|
||
"i18n":true
|
||
}
|
||
}
|
||
{% endif %}
|
||
{% else %}
|
||
{
|
||
"widgettype":"Text",
|
||
"options":{
|
||
"otext":"无效的参数,未找到模型ID",
|
||
"i18n":true
|
||
}
|
||
}
|
||
{% endif %}
|
||
{% else %}
|
||
{
|
||
"widgettype":"Text",
|
||
"options":{
|
||
"otext":"You need login to use llm",
|
||
"i18n":true
|
||
}
|
||
}
|
||
{% endif %}
|