-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_graph.py
More file actions
32 lines (24 loc) · 824 Bytes
/
Copy pathtest_graph.py
File metadata and controls
32 lines (24 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from main import app
from pprint import pprint
import os
from main import app
from pprint import pprint
from dotenv import load_dotenv
load_dotenv()
# Check for API Key
if "GEMINI_API_KEY" not in os.environ:
print("WARNING: GEMINI_API_KEY is not set in environment variables.")
def run_test():
print("Running Self-Corrective RAG Test...")
# Test case 1: A question that should be relevant
question = input("enter your search: ")
inputs = {"question": question}
print(f"\nQuestion: {question}")
for output in app.stream(inputs):
for key, value in output.items():
pprint(f"Node '{key}':")
# pprint(value, indent=2, width=80, depth=None)
print(f"\nFinal Generation:\n{value['generation']}")
if __name__ == "__main__":
run_test()