mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-06-26 22:00:19 +00:00
19 lines
318 B
Python
19 lines
318 B
Python
import os
|
|
import sys
|
|
sys.path.append('xxx/xxx/LightRAG')
|
|
|
|
from lightrag import LightRAG
|
|
|
|
os.environ["OPENAI_API_KEY"] = ""
|
|
|
|
WORKING_DIR = ""
|
|
|
|
if not os.path.exists(WORKING_DIR):
|
|
os.mkdir(WORKING_DIR)
|
|
|
|
rag = LightRAG(working_dir=WORKING_DIR)
|
|
|
|
with open('./text.txt', 'r') as f:
|
|
text = f.read()
|
|
|
|
rag.insert(text) |