llmage/wwwroot/llm_dialog.ui
yumoqing 6cc3986a2d feat: support multi-catalog for LLMs
- Create llm_catalog_rel model for one-to-many relationship
- Remove llmcatelogid from llm model
- Update SQL queries in utils.py and dspy files to use join
- Add maintenance UI (llm_catalog_rel_manage.ui) and API endpoints
- Filter options by user's orgid
2026-05-16 21:31:19 +08:00

76 lines
1.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% 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}}",
"response_mode": "{{llm.stream}}",
"icon":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}",
"url":"{{entire_url('/llmage/llminference.dspy')}}",
{% if llm.stream == 'stream' %}
"stream": true,
{% endif %}
{% if llm.stream =='async' %}
"query_url": "{{entire_url('/llmage/tasks')}}",
{% endif %}
"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 %}