Feat: 调用本地 Ollama

This commit is contained in:
2026-10-12 11:28:37 +08:00
parent c1a3461c49
commit 5d7228ebed
6 changed files with 98 additions and 43 deletions
+3 -2
View File
@@ -125,7 +125,7 @@ function setBusy(busy) {
docContent.disabled = !state.ready;
saveDoc.disabled = !state.ready;
pickFile.disabled = !state.ready;
sendButton.textContent = busy ? "检索中" : "提问";
sendButton.textContent = busy ? "回答中" : "提问";
}
function renderStatus(data) {
@@ -148,7 +148,8 @@ function renderStatus(data) {
const llm = el("span", "pill");
if (data.llm_ready) {
llm.classList.add("is-ok");
llm.textContent = `生成模型 ${data.llm_model}`;
const where = data.llm_provider === "ollama" ? "局域网 Ollama" : "生成模型";
llm.textContent = `${where} · ${data.llm_model}`;
} else {
llm.textContent = "未配置大模型,先摘录原文";
}
+2 -2
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>知迹 · 检索问答</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect fill='%231f6a52' width='32' height='32' rx='6'/%3E%3Cpath d='M8 9.5h7.2c1.6 0 2.8 1 2.8 2.6S16.8 15 15.2 15H8V9.5zm0 7h7.6c1.8 0 3.1 1.1 3.1 2.8S17.4 22 15.6 22H8v-5.5z' fill='%23f6f1e6'/%3E%3C/svg%3E" />
<link rel="stylesheet" href="/static/styles.css?v=1" />
<link rel="stylesheet" href="/static/styles.css?v=2" />
</head>
<body>
<div class="app">
@@ -73,6 +73,6 @@
</div>
</div>
<div id="toast" class="toast" role="status"></div>
<script src="/static/app.js?v=1"></script>
<script src="/static/app.js?v=2"></script>
</body>
</html>