v2.0.0 大模型驱动版:移除智能体,直接调用大模型接口

- 核心改造:不再使用 openclaw 智能体执行处理步骤,改为直接调用大模型接口
- 新增 services/llm_client.py:OpenAI 兼容接口客户端,支持多模型配置管理
- 步骤4/5 由大模型直接完成(提取产品数据、填充字段)
- 步骤6 改为直接调用 ParamHub API 提交审核
- 新增 llm_configs 数据库表,默认配置 unsloth/Qwen3.6-27B-Q4_K_M (262144上下文)
- 新增 /api/llm 配置管理 API:增删改查、切换激活、测试连接
- 前端首页新增「大模型配置」面板,可随时新增/切换模型
- 处理步骤名称更新为「大模型」版
This commit is contained in:
2026-08-13 17:15:53 +08:00
parent 6abd3389f3
commit 23991c3552
12 changed files with 1187 additions and 151 deletions
+78
View File
@@ -207,6 +207,40 @@
</div>
</div>
</div>
<!-- 大模型配置 -->
<div class="panel full-width">
<div class="panel-header">
<h2><i class="ri-openai-line"></i> 大模型配置</h2>
<div class="panel-actions">
<span class="active-model-badge" id="active-model-badge">
<span class="status-dot green"></span>
<span id="active-model-name">加载中...</span>
</span>
<button onclick="showAddLlmModal()" class="btn btn-primary btn-sm">
<i class="ri-add-line"></i> 新增大模型
</button>
</div>
</div>
<div class="panel-body">
<p class="llm-tip"><i class="ri-information-line"></i> 系统所有智能体任务(提取数据、填充字段等)均由当前激活的大模型直接完成,可在下方随时切换或新增。</p>
<table class="data-table">
<thead>
<tr>
<th>名称</th>
<th>接口地址</th>
<th>模型名称</th>
<th>上下文窗口</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="llm-config-table">
<tr><td colspan="6" class="empty-text">暂无大模型配置</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- 添加产品模态框 -->
@@ -357,6 +391,50 @@
</div>
</div>
<!-- 新增大模型模态框 -->
<div id="add-llm-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3><i class="ri-openai-line"></i> 新增大模型配置</h3>
<button onclick="closeModal('add-llm-modal')" class="close-btn">
<i class="ri-close-line"></i>
</button>
</div>
<div class="modal-body">
<form id="add-llm-form">
<div class="form-group">
<label>配置名称 *</label>
<input type="text" id="llm-name" required placeholder="例如:本地Qwen3.6">
</div>
<div class="form-group">
<label>接口地址 Base URL *</label>
<input type="text" id="llm-base-url" required placeholder="http://192.168.2.7:18003/v1">
<small class="hint">OpenAI 兼容接口地址,以 /v1 结尾</small>
</div>
<div class="form-group">
<label>API Key</label>
<input type="text" id="llm-api-key" placeholder="sk-xxxx">
</div>
<div class="form-group">
<label>模型名称 *</label>
<input type="text" id="llm-model-name" required placeholder="unsloth/Qwen3.6-27B-Q4_K_M">
</div>
<div class="form-group">
<label>最大上下文窗口</label>
<input type="number" id="llm-max-context" value="262144" min="4096" step="1024">
</div>
</form>
</div>
<div class="modal-footer">
<button onclick="testLlmConnection()" class="btn btn-secondary" id="llm-test-btn">
<i class="ri-connection-line"></i> 测试连接
</button>
<button onclick="closeModal('add-llm-modal')" class="btn btn-secondary">取消</button>
<button onclick="addLlmConfig()" class="btn btn-primary">添加</button>
</div>
</div>
</div>
<!-- 提示消息 -->
<div id="toast" class="toast"></div>