Auto-commit: OCR workflow improvements, performance optimizations, and bug fixes
This commit is contained in:
@@ -68,7 +68,19 @@ class SearchDataResponse(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
def create_search_routes(rag, api_key: Optional[str] = None, top_k: int = 60):
|
||||
def create_search_routes(rag_or_manager, api_key: Optional[str] = None, top_k: int = 60):
|
||||
# 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.post(
|
||||
|
||||
Reference in New Issue
Block a user