feat: 增强 WebUI 配置,支持防爬虫和安全 Cookie 设置

This commit is contained in:
墨梓柒
2025-12-19 00:44:22 +08:00
parent d3b71a7181
commit 3231995ebd
10 changed files with 107 additions and 47 deletions

View File

@@ -42,7 +42,10 @@ def lpmm_start_up(): # sourcery skip: extract-duplicate-method
logger.info("创建LLM客户端")
# 初始化Embedding库
embed_manager = EmbeddingManager()
embed_manager = EmbeddingManager(
max_workers=global_config.lpmm_knowledge.max_embedding_workers,
chunk_size=global_config.lpmm_knowledge.embedding_chunk_size,
)
logger.info("正在从文件加载Embedding库")
try:
embed_manager.load_from_file()

View File

@@ -358,12 +358,9 @@ class KGManager:
paragraph_search_result: ParagraphEmbedding的搜索结果paragraph_hash, similarity
embed_manager: EmbeddingManager对象
"""
# 性能保护:关闭或超限时直接返回向量检索结果(仅基于节点规模与开关)
if (
not global_config.lpmm_knowledge.enable_ppr
or len(self.graph.get_node_list()) > global_config.lpmm_knowledge.ppr_node_cap
):
logger.info("PPR 已禁用或超出阈值,使用纯向量检索结果")
# 性能保护:关闭时直接返回向量检索结果
if not global_config.lpmm_knowledge.enable_ppr:
logger.info("PPR 已禁用,使用纯向量检索结果")
return paragraph_search_result, None
# 图中存在的节点总集
existed_nodes = self.graph.get_node_list()