update
This commit is contained in:
19
examples/insert.py
Normal file
19
examples/insert.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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)
|
Reference in New Issue
Block a user