feat: 根据大模型视觉能力控制上传图片选项显示
- 前端加载 LLM 配置时保存 enable_vision 到 CONFIG - 上传弹窗根据 CONFIG.enableVision 决定是否显示图片上传选项 - 无视觉能力的大模型只显示上传文件选项 - 普通对话和智能体对话界面都应用此逻辑
This commit is contained in:
@@ -150,6 +150,8 @@ async function loadBackendConfig() {
|
||||
CONFIG.apiKey = backendConfig.llm.api_key;
|
||||
CONFIG.model = backendConfig.llm.model;
|
||||
CONFIG.maxTokens = backendConfig.llm.max_tokens || 2048;
|
||||
CONFIG.enableThinking = backendConfig.llm.enable_thinking || 0;
|
||||
CONFIG.enableVision = backendConfig.llm.enable_vision || 0;
|
||||
}
|
||||
|
||||
updateAgentsDisplay();
|
||||
@@ -3234,10 +3236,12 @@ function showAgentChatPage() {
|
||||
<!-- 上传选项弹窗 -->
|
||||
<div class="attach-panel" id="attachPanel">
|
||||
<div class="attach-panel-content">
|
||||
${CONFIG.enableVision ? `
|
||||
<div class="attach-item" data-type="image">
|
||||
<div class="attach-icon">📷</div>
|
||||
<div class="attach-label">上传图片</div>
|
||||
</div>
|
||||
` : ''}
|
||||
<div class="attach-item" data-type="file">
|
||||
<div class="attach-icon">📄</div>
|
||||
<div class="attach-label">上传文件</div>
|
||||
@@ -3763,10 +3767,12 @@ function openConversation(id) {
|
||||
<!-- 上传选项弹窗 -->
|
||||
<div class="attach-panel" id="attachPanel">
|
||||
<div class="attach-panel-content">
|
||||
${CONFIG.enableVision ? `
|
||||
<div class="attach-item" data-type="image">
|
||||
<div class="attach-icon">📷</div>
|
||||
<div class="attach-label">上传图片</div>
|
||||
</div>
|
||||
` : ''}
|
||||
<div class="attach-item" data-type="file">
|
||||
<div class="attach-icon">📄</div>
|
||||
<div class="attach-label">上传文件</div>
|
||||
|
||||
Reference in New Issue
Block a user