-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgithub_analysis.py
More file actions
42 lines (33 loc) · 1.63 KB
/
github_analysis.py
File metadata and controls
42 lines (33 loc) · 1.63 KB
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
import asyncio
from capyswarm import Swarm, Agent
from dotenv import load_dotenv
import os
load_dotenv()
async def main():
metadata_agent = Agent(
name="Metadata Analyst",
prompt="You are specialized in analyzing GitHub repository metadata, including stars, forks, issues, and community metrics. Focus on gathering and analyzing repository statistics and community health indicators.",
orchestrator=False,
)
code_agent = Agent(
name="Code Analyst",
prompt="You are specialized in analyzing GitHub repository code structure, architecture, and patterns. Focus on examining code organization, key features, and technical implementation details.",
orchestrator=False,
)
orchestrator = Agent(name="Orchestrator", orchestrator=True)
async with Swarm(
[metadata_agent, code_agent, orchestrator],
api_key=os.getenv("SCRAPYBARA_API_KEY"),
) as swarm:
await swarm.run(
prompt="""
Analyze the fastapi/fastapi GitHub repository (github.com/tiangolo/fastapi).
Work together to create a comprehensive analysis:
- Metadata Agent: Focus on community metrics, popularity trends, and repository statistics
- Code Agent: Focus on codebase structure, key features, and implementation patterns
Agents should share findings with each other to make connections between community metrics and code quality.
For example, if certain features have more community engagement or if code patterns affect adoption.
"""
)
if __name__ == "__main__":
asyncio.run(main())