fix: restore embedded wiki images and optimize vector sync
This commit is contained in:
1 parent
30943159bf
commit
0c5e2e8cb0
23 files changed
+609
-136
No files matched your search
@@ -279,65 +279,25 @@ llmwiki:
|
||||
|
||||
local_wiki_index:
|
||||
enabled: true
|
||||
|
||||
# 同步
|
||||
sync_enabled: true
|
||||
sync_interval_seconds: 120
|
||||
sync_page_size: 100
|
||||
sync_concurrency: 3
|
||||
sync_lease_seconds: 600
|
||||
sync_request_timeout_seconds: 30
|
||||
sync_max_retries: 3
|
||||
sync_retry_backoff_seconds: 5
|
||||
|
||||
# 切分
|
||||
chunk_max_chars: 1000
|
||||
chunk_overlap_chars: 120
|
||||
chunk_min_chars: 80
|
||||
title_prefix_enabled: true
|
||||
|
||||
# Embedding:OpenAI-compatible /v1/embeddings
|
||||
# 默认只允许手动向量化;需要定时增量同步时再开启。
|
||||
auto_sync: false
|
||||
# 每条 SQL 最多插入的向量行数;整页替换仍在同一事务内完成。
|
||||
database_batch_size: 50
|
||||
embedding:
|
||||
enabled: true
|
||||
provider: openai
|
||||
model: bge-m3
|
||||
base_url: "$WIKI_EMBEDDING_BASE_URL"
|
||||
api_key: "$WIKI_EMBEDDING_API_KEY"
|
||||
dimensions: 1024
|
||||
batch_size: 32
|
||||
timeout_seconds: 30
|
||||
max_retries: 3
|
||||
|
||||
# 检索
|
||||
engine: numpy_exact
|
||||
strict_vector: true
|
||||
top_k_sections: 30
|
||||
top_k_pages: 8
|
||||
max_sections_per_page: 2
|
||||
min_similarity: 0.35
|
||||
keyword_boost_enabled: false
|
||||
keyword_boost_weight: 0.15
|
||||
cache_max_knowledge_bases: 20
|
||||
cache_revision_check_seconds: 5
|
||||
|
||||
# 外部接口
|
||||
external_api:
|
||||
enabled: false
|
||||
api_key: "$LLMWIKI_EXTERNAL_SEARCH_API_KEY"
|
||||
max_query_chars: 1000
|
||||
max_knowledge_bases: 20
|
||||
max_results: 50
|
||||
default_results: 10
|
||||
include_content_max_chars: 12000
|
||||
requests_per_minute: 60
|
||||
```
|
||||
|
||||
日常部署只需配置上面三个 Embedding 值并将 `enabled` 改为 `true`。
|
||||
`auto_sync=false` 时仅由页面“手动向量化”触发;即使设为 `true`,定时器也会先等待一个完整同步周期,不会在服务刚启动时立即重建索引。其余切分、检索、超时与重试参数继续使用代码默认值,只有确有调优需要时才覆盖。
|
||||
|
||||
### 6.1 配置校验规则
|
||||
|
||||
启动时应执行:
|
||||
|
||||
1. `enabled=true` 时,Embedding `base_url` 和 `model` 必须非空;
|
||||
2. `dimensions` 可省略,但第一次成功 Embedding 后必须固定并写入索引 profile;
|
||||
2. 不向上游发送 `dimensions` 参数;第一次成功 Embedding 后从响应自动发现维度,并固定到索引 profile;
|
||||
3. `chunk_overlap_chars < chunk_max_chars`;
|
||||
4. `top_k_pages <= top_k_sections`;
|
||||
5. `external_api.enabled=true` 时必须配置非空 API Key;
|
||||
@@ -1885,9 +1845,7 @@ class WikiVectorEngine(ABC):
|
||||
|
||||
```text
|
||||
local_wiki_index.enabled
|
||||
local_wiki_index.sync_enabled
|
||||
local_wiki_index.internal_search_enabled
|
||||
local_wiki_index.reference_ui_enabled
|
||||
local_wiki_index.auto_sync
|
||||
local_wiki_index.external_api.enabled
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user