-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrew.py
25 lines (20 loc) · 901 Bytes
/
crew.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
import argparse
from crewai import Crew, Process
from tasks import research_task, write_task
from agents import news_researcher, news_writer
# Set up CLI argument parsing
parser = argparse.ArgumentParser(description="Run the InsightForge project to generate an article based on a specified topic.")
parser.add_argument("--topic", type=str, help="Topic for the article")
args = parser.parse_args()
# Check if topic is provided; if not, raise an exception
if not args.topic:
raise ValueError("Error: A topic must be provided. Use --topic to specify the topic for the article.")
# Form the tech-focused crew with some enhanced configuration
crew = Crew(
agents=[news_researcher, news_writer],
tasks=[research_task, write_task],
process=Process.sequential,
)
# Start the task execution process with the provided topic
result = crew.kickoff(inputs={'topic': args.topic})
print(result)