Refactor code and update environment type definitions.
- Consolidate type definitions in vite-env.d.ts - Update TypeScript include paths
This commit is contained in:
@@ -523,18 +523,18 @@ class LightRAG:
|
|||||||
"""
|
"""
|
||||||
# get params supported by get_knowledge_graph of specified storage
|
# get params supported by get_knowledge_graph of specified storage
|
||||||
import inspect
|
import inspect
|
||||||
storage_params = inspect.signature(self.chunk_entity_relation_graph.get_knowledge_graph).parameters
|
|
||||||
|
|
||||||
kwargs = {
|
storage_params = inspect.signature(
|
||||||
'node_label': node_label,
|
self.chunk_entity_relation_graph.get_knowledge_graph
|
||||||
'max_depth': max_depth
|
).parameters
|
||||||
}
|
|
||||||
|
|
||||||
if 'min_degree' in storage_params and min_degree > 0:
|
kwargs = {"node_label": node_label, "max_depth": max_depth}
|
||||||
kwargs['min_degree'] = min_degree
|
|
||||||
|
|
||||||
if 'inclusive' in storage_params:
|
if "min_degree" in storage_params and min_degree > 0:
|
||||||
kwargs['inclusive'] = inclusive
|
kwargs["min_degree"] = min_degree
|
||||||
|
|
||||||
|
if "inclusive" in storage_params:
|
||||||
|
kwargs["inclusive"] = inclusive
|
||||||
|
|
||||||
return await self.chunk_entity_relation_graph.get_knowledge_graph(**kwargs)
|
return await self.chunk_entity_relation_graph.get_knowledge_graph(**kwargs)
|
||||||
|
|
||||||
|
7
lightrag_webui/src/env.d.ts
vendored
7
lightrag_webui/src/env.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
/// <reference types="vite/client" />
|
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
|
||||||
readonly VITE_API_PROXY: string
|
|
||||||
readonly VITE_API_ENDPOINTS: string
|
|
||||||
readonly VITE_BACKEND_URL: string
|
|
||||||
}
|
|
10
lightrag_webui/src/vite-env.d.ts
vendored
10
lightrag_webui/src/vite-env.d.ts
vendored
@@ -1 +1,11 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_PROXY: string
|
||||||
|
readonly VITE_API_ENDPOINTS: string
|
||||||
|
readonly VITE_BACKEND_URL: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv
|
||||||
|
}
|
||||||
|
@@ -26,5 +26,5 @@
|
|||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src", "vite.config.ts"]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user