201 lines
9.9 KiB
XML
201 lines
9.9 KiB
XML
{
|
|
"widgettype": "TabPanel",
|
|
"options": {
|
|
"tab_pos": "top",
|
|
"items": [
|
|
{
|
|
"name": "reasoning_config",
|
|
"label": "推理引擎",
|
|
"icon": "settings",
|
|
"content": {
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"padding": "16px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Form",
|
|
"id": "engine_config_form",
|
|
"options": {
|
|
"data_url": "{{entire_url('api/config_get.dspy')}}",
|
|
"data_method": "GET",
|
|
"submit_url": "{{entire_url('api/config_save.dspy')}}",
|
|
"method": "POST",
|
|
"layout": "vertical",
|
|
"fields": [
|
|
{
|
|
"name": "max_reasoning_steps",
|
|
"label": "最大推理步骤数",
|
|
"uitype": "int",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "max_tool_calls_per_step",
|
|
"label": "每步最大工具调用数",
|
|
"uitype": "int",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "max_context_tokens",
|
|
"label": "最大上下文 token 数",
|
|
"uitype": "int",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "safety_mode",
|
|
"label": "安全模式",
|
|
"uitype": "code",
|
|
"required": true,
|
|
"data": [
|
|
{"value": "strict", "text": "严格"},
|
|
{"value": "moderate", "text": "中等"},
|
|
{"value": "lenient", "text": "宽松"}
|
|
]
|
|
},
|
|
{
|
|
"name": "enable_cross_session_search",
|
|
"label": "启用跨会话搜索",
|
|
"uitype": "check"
|
|
},
|
|
{
|
|
"name": "enable_skill_auto_loading",
|
|
"label": "启用技能自动加载",
|
|
"uitype": "check"
|
|
},
|
|
{
|
|
"name": "enable_error_recovery",
|
|
"label": "启用错误恢复",
|
|
"uitype": "check"
|
|
},
|
|
{
|
|
"name": "max_recovery_attempts",
|
|
"label": "最大恢复尝试次数",
|
|
"uitype": "int",
|
|
"required": true
|
|
}
|
|
],
|
|
"buttons": [
|
|
{
|
|
"type": "submit",
|
|
"label": "保存引擎配置",
|
|
"variant": "primary"
|
|
}
|
|
],
|
|
"maxWidth": "500px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "submited",
|
|
"actiontype": "script",
|
|
"script": "await bricks.show_resp_message_or_error(event.params)"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "model_config",
|
|
"label": "模型配置",
|
|
"icon": "code",
|
|
"content": {
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"padding": "16px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Form",
|
|
"id": "model_config_form",
|
|
"options": {
|
|
"data_url": "{{entire_url('api/config_get.dspy')}}",
|
|
"data_method": "GET",
|
|
"submit_url": "{{entire_url('api/config_save.dspy')}}",
|
|
"method": "POST",
|
|
"layout": "vertical",
|
|
"fields": [
|
|
{
|
|
"name": "model_name",
|
|
"label": "模型名称",
|
|
"uitype": "text",
|
|
"required": true,
|
|
"placeholder": "qwen3-max, claude-sonnet-4, gpt-4o..."
|
|
},
|
|
{
|
|
"name": "model_provider",
|
|
"label": "模型提供商",
|
|
"uitype": "code",
|
|
"required": true,
|
|
"data": [
|
|
{"value": "openrouter", "text": "OpenRouter"},
|
|
{"value": "anthropic", "text": "Anthropic"},
|
|
{"value": "dashscope", "text": "Dashscope (阿里云)"},
|
|
{"value": "openai", "text": "OpenAI"},
|
|
{"value": "custom", "text": "自定义"}
|
|
]
|
|
},
|
|
{
|
|
"name": "api_key",
|
|
"label": "API Key",
|
|
"uitype": "password",
|
|
"required": false,
|
|
"placeholder": "输入 API Key"
|
|
},
|
|
{
|
|
"name": "api_endpoint",
|
|
"label": "API Endpoint (可选)",
|
|
"uitype": "text",
|
|
"placeholder": "留空使用默认端点"
|
|
},
|
|
{
|
|
"name": "temperature",
|
|
"label": "Temperature (0.0-1.0)",
|
|
"uitype": "float",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "max_output_tokens",
|
|
"label": "最大输出 token 数",
|
|
"uitype": "int",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "top_p",
|
|
"label": "Top-p (0.0-1.0)",
|
|
"uitype": "float",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "system_prompt",
|
|
"label": "系统提示词模板",
|
|
"uitype": "textarea",
|
|
"rows": 4,
|
|
"placeholder": "留空使用默认系统提示词"
|
|
}
|
|
],
|
|
"buttons": [
|
|
{
|
|
"type": "submit",
|
|
"label": "保存模型配置",
|
|
"variant": "primary"
|
|
}
|
|
],
|
|
"maxWidth": "500px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "submited",
|
|
"actiontype": "script",
|
|
"script": "await bricks.show_resp_message_or_error(event.params)"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|