GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ai-tutorial-crew/main.py at main · SRafi007/ai-tutorial-crew

Expand file tree

/

main.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
55 lines (40 loc) · 1.38 KB
/

main.py

Copy path

File metadata and controls

55 lines (40 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# main.py
from crewai import Crew
from agents.researcher import ResearchAgent
from agents.writer import WriterAgent
from agents.reviewer import ReviewerAgent
from tasks.generate_tutorial import GenerateTutorialTask
import os
from models.local_llm import get_local_llm
OUTPUT_DIR = "output"
OUTPUT_FILE = os.path.join(OUTPUT_DIR, "tutorial.md")
def save_output_to_file(content):
os.makedirs(OUTPUT_DIR, exist_ok=True)
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
# Handle CrewOutput object - extract the raw content
if hasattr(content, "raw"):
f.write(str(content.raw))
else:
f.write(str(content))
def run(topic):
llm = get_local_llm()
researcher = ResearchAgent().create()
writer = WriterAgent().create()
reviewer = ReviewerAgent().create()
# Apply LLM override
researcher.llm = llm
writer.llm = llm
reviewer.llm = llm
# Pass topic to task generator
tasks = GenerateTutorialTask().create(researcher, writer, reviewer, topic)
crew = Crew(agents=[researcher, writer, reviewer], tasks=tasks, verbose=True)
print(f"\n🚀 Running your AI Tutorial Team for topic: {topic}...\n")
result = crew.kickoff()
print("\n📘 Final Output:\n")
print(result)
save_output_to_file(result)
print(f"\n✅ Output saved to {OUTPUT_FILE}")
"""
if __name__ == "__main__":
run()
"""
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.