-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
38 lines (31 loc) · 1.2 KB
/
main.py
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
33
34
35
36
37
38
from src.graph.graph import app
from src.index.indexer import ingest_document
click_up_url = input("📝 Enter ClickUp Docs URL: ")
ingest_document(click_up_url)
while True:
print(
"-------------------------------------------------------------------------------"
)
query = input("🤔 User: Enter your query: ")
if len(query.strip()) == 0:
continue
inputs = {"question": query, "original_question": query}
try:
for output in app.stream(inputs):
for key, value in output.items():
# Node
print(f"Node '{key}':")
# Optional: print full state at each node
# pprint.pprint(value["keys"], indent=2, width=80, depth=None)
print("\n---\n")
# Final generation
print("🎯 LLM:", value["generation"])
except Exception as e:
print(f"❌ An error occurred while processing your query: {e}")
print(
"-------------------------------------------------------------------------------"
)
should_continue = input("Do you want to continue? (y/n): ").strip().lower()
if should_continue == "n":
break
print("👋 Exiting Clickup Llama. Goodbye!")