Auto-commit: OCR workflow improvements, performance optimizations, and bug fixes
This commit is contained in:
@@ -25,7 +25,19 @@ class RelationUpdateRequest(BaseModel):
|
||||
updated_data: Dict[str, Any]
|
||||
|
||||
|
||||
def create_graph_routes(rag, api_key: Optional[str] = None):
|
||||
def create_graph_routes(rag_or_manager, api_key: Optional[str] = None):
|
||||
# Accept either a LightRAG instance or a WorkspaceManager
|
||||
from lightrag.api.workspace_manager import WorkspaceManager
|
||||
from lightrag import LightRAG
|
||||
|
||||
if isinstance(rag_or_manager, WorkspaceManager):
|
||||
# Get default RAG instance from workspace manager
|
||||
rag = rag_or_manager.get_rag()
|
||||
elif isinstance(rag_or_manager, LightRAG):
|
||||
rag = rag_or_manager
|
||||
else:
|
||||
raise TypeError(f"Expected LightRAG or WorkspaceManager, got {type(rag_or_manager)}")
|
||||
|
||||
combined_auth = get_combined_auth_dependency(api_key)
|
||||
|
||||
@router.get("/graph/label/list", dependencies=[Depends(combined_auth)])
|
||||
|
||||
Reference in New Issue
Block a user