forked from Eyalbenba/tavily-web-eval-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (25 loc) · 806 Bytes
/
main.py
File metadata and controls
28 lines (25 loc) · 806 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
import dotenv
dotenv.load_dotenv()
import os
import asyncio
from web_eval_generator.graph import graph
from web_eval_generator.state import GeneratorState
async def main():
# Initialize ResearchState with user inputs
qa_subjects = \
[
"Basketball",
"Baseball"
]
state = GeneratorState(num_qa=5,qa_subjects=qa_subjects)
# Run the graph workflow
print("Starting the QA Generation workflow...")
try:
result = await graph.ainvoke(state) # Use `ainvoke` for async execution
print("\nWorkflow completed successfully.")
print("Final state:", result)
except Exception as e:
print(f"An error occurred during the workflow execution: {e}")
# Run the async main function
if __name__ == "__main__":
asyncio.run(main())