researchpilot-api / test_stream.py
Subhadip007's picture
fix(api): improve stream token chunks robustness and sync year filter
3394ee5
raw
history blame contribute delete
314 Bytes
import os
import sys
from dotenv import load_dotenv
load_dotenv()
sys.path.append(os.getcwd())
from src.rag.pipeline import RAGPipeline
try:
pipeline = RAGPipeline()
gen = pipeline.stream_query("What is LoRA?", top_k=2)
for x in gen:
print(x)
except Exception as e:
print(f"Error: {e}")