mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-11-07 05:14:17 +00:00
fixed linting
This commit is contained in:
parent
a68aebb124
commit
f307ed43f5
@ -1789,9 +1789,9 @@ def create_app(args):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
trace_exception(e)
|
trace_exception(e)
|
||||||
raise HTTPException(status_code=500, detail=str(e))
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
@app.get("/documents", dependencies=[Depends(optional_api_key)])
|
@app.get("/documents", dependencies=[Depends(optional_api_key)])
|
||||||
async def get_status():
|
async def documents():
|
||||||
"""Get current system status"""
|
"""Get current system status"""
|
||||||
return doc_manager.indexed_files
|
return doc_manager.indexed_files
|
||||||
|
|
||||||
@ -1831,7 +1831,7 @@ def create_app(args):
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
# Serve the static files
|
# Serve the static files
|
||||||
static_dir = Path(__file__).parent / "static"
|
static_dir = Path(__file__).parent / "static"
|
||||||
static_dir.mkdir(exist_ok=True)
|
static_dir.mkdir(exist_ok=True)
|
||||||
app.mount("/", StaticFiles(directory=static_dir, html=True), name="static")
|
app.mount("/", StaticFiles(directory=static_dir, html=True), name="static")
|
||||||
|
|
||||||
|
|||||||
@ -10,25 +10,25 @@
|
|||||||
.fade-in {
|
.fade-in {
|
||||||
animation: fadeIn 0.3s ease-in;
|
animation: fadeIn 0.3s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
from { opacity: 0; }
|
from { opacity: 0; }
|
||||||
to { opacity: 1; }
|
to { opacity: 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.spin {
|
.spin {
|
||||||
animation: spin 1s linear infinite;
|
animation: spin 1s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
from { transform: rotate(0deg); }
|
from { transform: rotate(0deg); }
|
||||||
to { transform: rotate(360deg); }
|
to { transform: rotate(360deg); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.slide-in {
|
.slide-in {
|
||||||
animation: slideIn 0.3s ease-out;
|
animation: slideIn 0.3s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slideIn {
|
@keyframes slideIn {
|
||||||
from { transform: translateX(-100%); }
|
from { transform: translateX(-100%); }
|
||||||
to { transform: translateX(0); }
|
to { transform: translateX(0); }
|
||||||
@ -128,7 +128,7 @@
|
|||||||
'file-manager': () => `
|
'file-manager': () => `
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<h2 class="text-2xl font-bold text-gray-800">File Manager</h2>
|
<h2 class="text-2xl font-bold text-gray-800">File Manager</h2>
|
||||||
|
|
||||||
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-gray-400 transition-colors">
|
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-gray-400 transition-colors">
|
||||||
<input type="file" id="fileInput" multiple accept=".txt,.md,.doc,.docx,.pdf,.pptx" class="hidden">
|
<input type="file" id="fileInput" multiple accept=".txt,.md,.doc,.docx,.pdf,.pptx" class="hidden">
|
||||||
<label for="fileInput" class="cursor-pointer">
|
<label for="fileInput" class="cursor-pointer">
|
||||||
@ -166,7 +166,7 @@
|
|||||||
'query': () => `
|
'query': () => `
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<h2 class="text-2xl font-bold text-gray-800">Query Database</h2>
|
<h2 class="text-2xl font-bold text-gray-800">Query Database</h2>
|
||||||
|
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700">Query Mode</label>
|
<label class="block text-sm font-medium text-gray-700">Query Mode</label>
|
||||||
@ -223,15 +223,15 @@
|
|||||||
'settings': () => `
|
'settings': () => `
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<h2 class="text-2xl font-bold text-gray-800">Settings</h2>
|
<h2 class="text-2xl font-bold text-gray-800">Settings</h2>
|
||||||
|
|
||||||
<div class="max-w-xl">
|
<div class="max-w-xl">
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700">API Key</label>
|
<label class="block text-sm font-medium text-gray-700">API Key</label>
|
||||||
<input type="password" id="apiKeyInput" value="${state.apiKey}"
|
<input type="password" id="apiKeyInput" value="${state.apiKey}"
|
||||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
|
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="saveSettings" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors">
|
<button id="saveSettings" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors">
|
||||||
Save Settings
|
Save Settings
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -340,7 +340,6 @@ class Neo4JStorage(BaseGraphStorage):
|
|||||||
async def _node2vec_embed(self):
|
async def _node2vec_embed(self):
|
||||||
print("Implemented but never called.")
|
print("Implemented but never called.")
|
||||||
|
|
||||||
|
|
||||||
async def get_knowledge_graph(
|
async def get_knowledge_graph(
|
||||||
self, node_label: str, max_depth: int = 5
|
self, node_label: str, max_depth: int = 5
|
||||||
) -> Dict[str, List[Dict]]:
|
) -> Dict[str, List[Dict]]:
|
||||||
@ -448,7 +447,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||||||
|
|
||||||
# Add node data (with complete labels)
|
# Add node data (with complete labels)
|
||||||
node_data = {k: v for k, v in node.items()}
|
node_data = {k: v for k, v in node.items()}
|
||||||
node_data["labels"] = [current_label] # Assume get_node method returns label information
|
node_data["labels"] = [
|
||||||
|
current_label
|
||||||
|
] # Assume get_node method returns label information
|
||||||
result["nodes"].append(node_data)
|
result["nodes"].append(node_data)
|
||||||
|
|
||||||
# Get all outgoing and incoming edges
|
# Get all outgoing and incoming edges
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user