mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 15:05:51 +00:00
99 lines
4.8 KiB
HTML
99 lines
4.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>翰林院 - RAG 向量数据库</title>
|
|
<link rel="stylesheet" href="hanlinyuan.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<div class="header-content">
|
|
<h2>翰林院 - RAG 向量数据库</h2>
|
|
<p>为每个角色卡构建独立的、基于历史记录的检索增强生成系统。</p>
|
|
</div>
|
|
<button id="amily2_back_to_main_from_hanlinyuan" class="menu_button secondary small_button interactable">
|
|
<i class="fas fa-arrow-left"></i> 返回主殿
|
|
</button>
|
|
</div>
|
|
|
|
<div class="section character-selection-section">
|
|
<h3>当前操作角色</h3>
|
|
<select id="character-select" class="text_pole"></select>
|
|
</div>
|
|
|
|
<div class="tab-nav">
|
|
<button class="tab-button active" data-tab="api-settings">API 设置</button>
|
|
<button class="tab-button" data-tab="rag-params">RAG 参数</button>
|
|
</div>
|
|
|
|
<div id="api-settings" class="tab-content active">
|
|
<h4>嵌入模型 API 配置</h4>
|
|
<div class="form-group">
|
|
<label for="embedding-api-url">API 地址:</label>
|
|
<input type="text" id="embedding-api-url" class="text_pole" placeholder="例如: https://api.siliconflow.cn/v1">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="embedding-api-key">API 密钥 (Key):</label>
|
|
<input type="password" id="embedding-api-key" class="text_pole" placeholder="请输入您的 API Key">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="embedding-model-select">嵌入模型:</label>
|
|
<select id="embedding-model-select" class="text_pole"></select>
|
|
</div>
|
|
<div class="button-group inline">
|
|
<button id="fetch-models" class="menu_button compact">获取</button>
|
|
<button id="test-connection" class="menu_button compact">测试</button>
|
|
<button id="save-api-config" class="menu_button compact accent">保存</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="rag-params" class="tab-content">
|
|
<h4>检索增强参数配置</h4>
|
|
<div class="form-group form-group-inline">
|
|
<label for="rag-enabled">启用RAG注入:</label>
|
|
<input type="checkbox" id="rag-enabled" class="inline-checkbox">
|
|
<small>启用后,将在每次提问时自动检索相关信息并注入到提示词中。</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="chunk-size">文本分块大小 (Chunk Size):</label>
|
|
<input type="number" id="chunk-size" class="text_pole" value="512" min="64" max="2048">
|
|
<small>将总结分割成多大的文本块(单位:字符)</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="top-k">检索数量 (Top-K):</label>
|
|
<input type="number" id="top-k" class="text_pole" value="3" min="1" max="10">
|
|
<small>检索最相关的多少个文本块发送给主模型</small>
|
|
</div>
|
|
<div class="button-group">
|
|
<button id="save-rag-params" class="menu_button compact accent">保存</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h3>知识库管理</h3>
|
|
<div class="form-group">
|
|
<label for="rag-source-text">手动索引文本源:</label>
|
|
<textarea id="rag-source-text" class="text_pole" rows="6" placeholder="可在此处粘贴任意文本(如角色背景、世界观设定等)进行手动向量化。 注意:由“大史官”自动生成的总结会根据其设置自动索引,无需在此手动操作。"></textarea>
|
|
</div>
|
|
<div class="button-group inline">
|
|
<button id="update-vector-db" class="menu_button compact accent">更新索引</button>
|
|
<button id="clear-vector-db" class="menu_button compact danger">清空数据</button>
|
|
</div>
|
|
<div id="db-status" class="status-panel">
|
|
<p>状态: <span id="db-status-value">未初始化</span></p>
|
|
<p>文档数量: <span id="db-doc-count">0</span></p>
|
|
<p>最后更新时间: <span id="db-last-updated">N/A</span></p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h3>日志输出</h3>
|
|
<div id="log-output" class="log-panel">
|
|
<p>欢迎使用翰林院...</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|