feat(server): add workbench API, DSH planner worker and RAG pipeline

This commit is contained in:
yi
2026-09-16 19:06:20 +08:00
parent 72fc5b47c7
commit d4b5b3f43a
122 changed files with 31906 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
"""清理未完成的 SRT 导入:重置 kb_3 collection + 更新库状态为空"""
import sys
sys.path.insert(0, r'C:\Users\xinmiclaw\Desktop\雅文内容创造工作台\server')
from sqlmodel import Session, select
from app.db import engine
from app.models import KnowledgeBase
from app.rag import store
# 重置向量 collection(防半成品索引损坏)
try:
store.reset_kb(3)
print("kb_3 collection 已重置")
except Exception as e:
print("重置异常:", e)
# 更新库状态
with Session(engine) as s:
kb = s.exec(select(KnowledgeBase).where(KnowledgeBase.name == "直播原文库")).first()
if kb:
kb.index_status = "empty"
kb.file_count = 0
kb.chunk_count = 0
s.add(kb); s.commit()
print("直播原文库状态 → empty(以后想导入随时可导)")
else:
print("未找到直播原文库记录")