fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
AutoFix Bot
2026-03-02 12:14:39 +08:00
parent e23f1fec08
commit 98527c4de4
39 changed files with 8109 additions and 8147 deletions

View File

@@ -1166,7 +1166,7 @@ async def create_manual_entity(
start_pos=entity.start_pos,
end_pos=entity.end_pos,
text_snippet=text[
max(0, entity.start_pos - 20) : min(len(text), entity.end_pos + 20)
max(0, entity.start_pos - 20): min(len(text), entity.end_pos + 20)
],
confidence=1.0,
)
@@ -1408,7 +1408,7 @@ async def upload_audio(project_id: str, file: UploadFile = File(...), _=Depends(
start_pos=pos,
end_pos=pos + len(name),
text_snippet=full_text[
max(0, pos - 20) : min(len(full_text), pos + len(name) + 20)
max(0, pos - 20): min(len(full_text), pos + len(name) + 20)
],
confidence=1.0,
)
@@ -1534,7 +1534,7 @@ async def upload_document(project_id: str, file: UploadFile = File(...), _=Depen
start_pos=pos,
end_pos=pos + len(name),
text_snippet=full_text[
max(0, pos - 20) : min(len(full_text), pos + len(name) + 20)
max(0, pos - 20): min(len(full_text), pos + len(name) + 20)
],
confidence=1.0,
)
@@ -3804,10 +3804,10 @@ async def system_status():
# ==================== Phase 7: Workflow Automation Endpoints ====================
# Workflow Manager singleton
_workflow_manager: "WorkflowManager | None" = None
_workflow_manager: Any = None
def get_workflow_manager_instance() -> "WorkflowManager | None":
def get_workflow_manager_instance() -> Any:
global _workflow_manager
if _workflow_manager is None and WORKFLOW_AVAILABLE and DB_AVAILABLE:
from workflow_manager import WorkflowManager