parthib07 commited on
Commit
447d754
·
verified ·
1 Parent(s): de3104a

Upload 64 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +36 -35
  2. Dockerfile +22 -20
  3. agents/__pycache__/business_analyst.cpython-310.pyc +0 -0
  4. agents/__pycache__/business_analyst.cpython-311.pyc +0 -0
  5. agents/__pycache__/business_analyst.cpython-313.pyc +0 -0
  6. agents/__pycache__/designer.cpython-310.pyc +0 -0
  7. agents/__pycache__/designer.cpython-311.pyc +0 -0
  8. agents/__pycache__/designer.cpython-313.pyc +0 -0
  9. agents/__pycache__/developer.cpython-310.pyc +0 -0
  10. agents/__pycache__/developer.cpython-311.pyc +0 -0
  11. agents/__pycache__/developer.cpython-313.pyc +0 -0
  12. agents/__pycache__/project_manager.cpython-310.pyc +0 -0
  13. agents/__pycache__/project_manager.cpython-311.pyc +0 -0
  14. agents/__pycache__/project_manager.cpython-313.pyc +0 -0
  15. agents/__pycache__/tester.cpython-310.pyc +0 -0
  16. agents/__pycache__/tester.cpython-311.pyc +0 -0
  17. agents/__pycache__/tester.cpython-313.pyc +0 -0
  18. agents/business_analyst.py +46 -0
  19. agents/designer.py +44 -0
  20. agents/developer.py +111 -0
  21. agents/project_manager.py +123 -0
  22. agents/tester.py +66 -0
  23. api/__pycache__/main.cpython-310.pyc +0 -0
  24. app.py +167 -0
  25. chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/data_level0.bin +3 -0
  26. chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/header.bin +3 -0
  27. chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/length.bin +3 -0
  28. chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/link_lists.bin +3 -0
  29. chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/data_level0.bin +3 -0
  30. chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/header.bin +3 -0
  31. chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/length.bin +3 -0
  32. chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/link_lists.bin +3 -0
  33. chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/data_level0.bin +3 -0
  34. chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/header.bin +3 -0
  35. chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/length.bin +3 -0
  36. chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/link_lists.bin +3 -0
  37. chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/data_level0.bin +3 -0
  38. chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/header.bin +3 -0
  39. chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/length.bin +3 -0
  40. chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/link_lists.bin +3 -0
  41. chroma_db/chroma.sqlite3 +3 -0
  42. chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/data_level0.bin +3 -0
  43. chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/header.bin +3 -0
  44. chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/length.bin +3 -0
  45. chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/link_lists.bin +3 -0
  46. core/__pycache__/base_agent.cpython-310.pyc +0 -0
  47. core/__pycache__/base_agent.cpython-311.pyc +0 -0
  48. core/__pycache__/base_agent.cpython-313.pyc +0 -0
  49. core/__pycache__/config.cpython-310.pyc +0 -0
  50. core/__pycache__/config.cpython-311.pyc +0 -0
.gitattributes CHANGED
@@ -1,35 +1,36 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ chroma_db/chroma.sqlite3 filter=lfs diff=lfs merge=lfs -text
Dockerfile CHANGED
@@ -1,20 +1,22 @@
1
- FROM python:3.13.5-slim
2
-
3
- WORKDIR /app
4
-
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
-
14
- RUN pip3 install -r requirements.txt
15
-
16
- EXPOSE 8501
17
-
18
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
19
-
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
1
+ # AI Virtual Pod - Streamlit application
2
+ FROM python:3.11-slim
3
+
4
+ WORKDIR /app
5
+
6
+ # Install dependencies first for better layer caching
7
+ COPY requirements.txt .
8
+ RUN pip install --no-cache-dir -r requirements.txt
9
+
10
+ # Copy application code
11
+ COPY app.py .
12
+ COPY agents/ agents/
13
+ COPY core/ core/
14
+
15
+ # ChromaDB may write to disk; optional data dir
16
+ ENV CHROMA_PERSIST_DIR=/app/chroma_db
17
+
18
+ # Streamlit runs on 8501 by default
19
+ EXPOSE 8501
20
+
21
+ # Run the app (bind to 0.0.0.0 so it's reachable from outside the container)
22
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
agents/__pycache__/business_analyst.cpython-310.pyc ADDED
Binary file (1.75 kB). View file
 
agents/__pycache__/business_analyst.cpython-311.pyc ADDED
Binary file (2.36 kB). View file
 
agents/__pycache__/business_analyst.cpython-313.pyc ADDED
Binary file (2.13 kB). View file
 
agents/__pycache__/designer.cpython-310.pyc ADDED
Binary file (1.7 kB). View file
 
agents/__pycache__/designer.cpython-311.pyc ADDED
Binary file (2.3 kB). View file
 
agents/__pycache__/designer.cpython-313.pyc ADDED
Binary file (2.07 kB). View file
 
agents/__pycache__/developer.cpython-310.pyc ADDED
Binary file (3.58 kB). View file
 
agents/__pycache__/developer.cpython-311.pyc ADDED
Binary file (4.69 kB). View file
 
agents/__pycache__/developer.cpython-313.pyc ADDED
Binary file (4.3 kB). View file
 
agents/__pycache__/project_manager.cpython-310.pyc ADDED
Binary file (3.14 kB). View file
 
agents/__pycache__/project_manager.cpython-311.pyc ADDED
Binary file (4.83 kB). View file
 
agents/__pycache__/project_manager.cpython-313.pyc ADDED
Binary file (4.35 kB). View file
 
agents/__pycache__/tester.cpython-310.pyc ADDED
Binary file (2.14 kB). View file
 
agents/__pycache__/tester.cpython-311.pyc ADDED
Binary file (2.99 kB). View file
 
agents/__pycache__/tester.cpython-313.pyc ADDED
Binary file (2.72 kB). View file
 
agents/business_analyst.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from core.base_agent import BaseAgent
2
+ from core.database import db
3
+ from typing import Dict, Any
4
+
5
+ class BusinessAnalystAgent(BaseAgent):
6
+ def __init__(self):
7
+ super().__init__("Business Analyst")
8
+ self.create_chain("""
9
+ You are a Business Analyst. Your task is to create detailed user stories from the given business requirements.
10
+
11
+ Business Requirements:
12
+ {input}
13
+
14
+ Create user stories following this format:
15
+ As a [type of user]
16
+ I want [some goal]
17
+ So that [some reason]
18
+
19
+ Acceptance Criteria:
20
+ 1. [First criterion]
21
+ 2. [Second criterion]
22
+ ...
23
+
24
+ Please provide clear, testable user stories with specific acceptance criteria.
25
+ """)
26
+
27
+ async def create_user_stories(self, requirements: str) -> Dict[str, Any]:
28
+ """Create user stories from business requirements"""
29
+ result = await self.process({"input": requirements})
30
+
31
+ # Store the user stories in the database
32
+ db.store_artifact(
33
+ "user_stories",
34
+ result,
35
+ {
36
+ "type": "user_story",
37
+ "source": "business_analyst",
38
+ "status": "created"
39
+ }
40
+ )
41
+
42
+ return {
43
+ "status": "success",
44
+ "user_stories": result,
45
+ "message": "User stories created successfully"
46
+ }
agents/designer.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from core.base_agent import BaseAgent
2
+ from core.database import db
3
+ from typing import Dict, Any
4
+
5
+ class DesignerAgent(BaseAgent):
6
+ def __init__(self):
7
+ super().__init__("Designer")
8
+ self.create_chain("""
9
+ You are a Software Designer. Your task is to create detailed design specifications from the given user stories.
10
+
11
+ User Stories:
12
+ {input}
13
+
14
+ Create a comprehensive design document that includes:
15
+ 1. System Architecture
16
+ 2. Component Design
17
+ 3. Database Schema
18
+ 4. API Endpoints
19
+ 5. Data Flow Diagrams
20
+ 6. Security Considerations
21
+
22
+ Please provide a detailed, implementable design that follows best practices and design patterns.
23
+ """)
24
+
25
+ async def create_design(self, user_stories: str) -> Dict[str, Any]:
26
+ """Create design specifications from user stories"""
27
+ result = await self.process({"input": user_stories})
28
+
29
+ # Store the design in the database
30
+ db.store_artifact(
31
+ "designs",
32
+ result,
33
+ {
34
+ "type": "design",
35
+ "source": "designer",
36
+ "status": "created"
37
+ }
38
+ )
39
+
40
+ return {
41
+ "status": "success",
42
+ "design": result,
43
+ "message": "Design specifications created successfully"
44
+ }
agents/developer.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from core.base_agent import BaseAgent
2
+ from core.database import db
3
+ from typing import Dict, Any
4
+
5
+ class DeveloperAgent(BaseAgent):
6
+ def __init__(self):
7
+ super().__init__("Developer")
8
+ self.create_chain("""
9
+ You are an expert Software Developer. Your task is to generate production-ready, well-structured code based on the given design specifications.
10
+
11
+ Design Specifications:
12
+ {input}
13
+
14
+ Generate code that follows these strict guidelines:
15
+
16
+ 1. Code Structure:
17
+ - Use proper project structure with separate modules
18
+ - Follow SOLID principles
19
+ - Implement proper error handling
20
+ - Use type hints
21
+ - Include comprehensive docstrings
22
+ - Follow PEP 8 style guide
23
+
24
+ 2. Implementation Details:
25
+ - Use modern Python features (Python 3.9+)
26
+ - Implement proper logging
27
+ - Add input validation
28
+ - Include unit tests
29
+ - Use dependency injection where appropriate
30
+ - Implement proper configuration management
31
+
32
+ 3. Security:
33
+ - Sanitize all inputs
34
+ - Implement proper authentication/authorization
35
+ - Use secure coding practices
36
+ - Handle sensitive data properly
37
+
38
+ 4. Performance:
39
+ - Optimize database queries
40
+ - Implement caching where appropriate
41
+ - Use async/await for I/O operations
42
+ - Implement proper resource management
43
+
44
+ 5. Documentation:
45
+ - Include detailed module docstrings
46
+ - Document all public methods
47
+ - Include usage examples
48
+ - Document configuration options
49
+
50
+ The code should be:
51
+ - Production-ready
52
+ - Well-tested
53
+ - Scalable
54
+ - Maintainable
55
+ - Secure
56
+ - Performant
57
+
58
+ Provide the complete implementation with all necessary files and dependencies.
59
+ """)
60
+
61
+ async def generate_code(self, design: str) -> Dict[str, Any]:
62
+ """Generate code from design specifications"""
63
+ result = await self.process({"input": design})
64
+
65
+ # Store the code in the database
66
+ db.store_artifact(
67
+ "code",
68
+ result,
69
+ {
70
+ "type": "code",
71
+ "source": "developer",
72
+ "status": "created",
73
+ "version": "1.0.0"
74
+ }
75
+ )
76
+
77
+ return {
78
+ "status": "success",
79
+ "code": result,
80
+ "message": "Code generated successfully",
81
+ "metadata": {
82
+ "language": "Python",
83
+ "framework": "Standard Library",
84
+ "dependencies": self._extract_dependencies(result)
85
+ }
86
+ }
87
+
88
+ def _extract_dependencies(self, code: str) -> list:
89
+ """Extract dependencies from the generated code"""
90
+ dependencies = set()
91
+ # Add common dependencies
92
+ dependencies.update([
93
+ "python-dotenv",
94
+ "pydantic",
95
+ "fastapi",
96
+ "uvicorn",
97
+ "pytest",
98
+ "pytest-asyncio"
99
+ ])
100
+
101
+ # Add dependencies based on code content
102
+ if "import sqlalchemy" in code:
103
+ dependencies.add("sqlalchemy")
104
+ if "import aiohttp" in code:
105
+ dependencies.add("aiohttp")
106
+ if "import redis" in code:
107
+ dependencies.add("redis")
108
+ if "import jwt" in code:
109
+ dependencies.add("PyJWT")
110
+
111
+ return sorted(list(dependencies))
agents/project_manager.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from core.base_agent import BaseAgent
2
+ from core.database import db
3
+ from core.workflow import DevelopmentWorkflow
4
+ from typing import Dict, Any
5
+
6
+ class ProjectManagerAgent(BaseAgent):
7
+ def __init__(self):
8
+ super().__init__("Project Manager")
9
+ self.workflow = DevelopmentWorkflow()
10
+
11
+ self.create_chain("""
12
+ You are a Project Manager. Your task is to oversee the development process and provide status updates.
13
+
14
+ Current Status:
15
+ {input}
16
+
17
+ Please provide a comprehensive status report including:
18
+ 1. Project progress
19
+ 2. Any blockers or issues
20
+ 3. Next steps
21
+ 4. Quality metrics
22
+ 5. Recommendations
23
+
24
+ Please provide clear, actionable insights.
25
+ """)
26
+
27
+ async def start_project(self, requirements: str) -> Dict[str, Any]:
28
+ """Start a new project with the given requirements"""
29
+ # Run the complete workflow
30
+ result = await self.workflow.run(requirements)
31
+
32
+ # Store all artifacts in the database
33
+ self._store_artifacts(result)
34
+
35
+ return {
36
+ "status": "success",
37
+ "user_stories": result["user_stories"],
38
+ "design": result["design"],
39
+ "code": result["code"],
40
+ "test_results": result["test_results"],
41
+ "messages": result["messages"],
42
+ "message": "Project completed successfully"
43
+ }
44
+
45
+ def _store_artifacts(self, result: Dict[str, Any]):
46
+ """Store all project artifacts in the database"""
47
+ # Store user stories
48
+ db.store_artifact(
49
+ "user_stories",
50
+ result["user_stories"],
51
+ {
52
+ "type": "user_story",
53
+ "source": "business_analyst",
54
+ "status": "created"
55
+ }
56
+ )
57
+
58
+ # Store design
59
+ db.store_artifact(
60
+ "designs",
61
+ result["design"],
62
+ {
63
+ "type": "design",
64
+ "source": "designer",
65
+ "status": "created"
66
+ }
67
+ )
68
+
69
+ # Store code
70
+ db.store_artifact(
71
+ "code",
72
+ result["code"],
73
+ {
74
+ "type": "code",
75
+ "source": "developer",
76
+ "status": "created",
77
+ "version": "1.0.0"
78
+ }
79
+ )
80
+
81
+ # Store test results
82
+ db.store_artifact(
83
+ "test_results",
84
+ result["test_results"],
85
+ {
86
+ "type": "test_result",
87
+ "source": "tester",
88
+ "status": "executed"
89
+ }
90
+ )
91
+
92
+ async def get_status(self) -> Dict[str, Any]:
93
+ """Get the current project status"""
94
+ # Query all artifacts from the database
95
+ user_stories = db.query_artifacts("user_stories", "status:created")
96
+ designs = db.query_artifacts("designs", "status:created")
97
+ code = db.query_artifacts("code", "status:created")
98
+ test_results = db.query_artifacts("test_results", "status:executed")
99
+
100
+ status = {
101
+ "user_stories": len(user_stories["ids"]),
102
+ "designs": len(designs["ids"]),
103
+ "code": len(code["ids"]),
104
+ "test_results": len(test_results["ids"])
105
+ }
106
+
107
+ return {
108
+ "status": "success",
109
+ "data": status,
110
+ "message": "Status retrieved successfully"
111
+ }
112
+
113
+ async def check_quality(self) -> Dict[str, Any]:
114
+ """Check the quality of project artifacts"""
115
+ result = await self.process({
116
+ "input": "Checking quality of all project artifacts"
117
+ })
118
+
119
+ return {
120
+ "status": "success",
121
+ "quality_report": result,
122
+ "message": "Quality check completed successfully"
123
+ }
agents/tester.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from core.base_agent import BaseAgent
2
+ from core.database import db
3
+ from typing import Dict, Any
4
+
5
+ class TesterAgent(BaseAgent):
6
+ def __init__(self):
7
+ super().__init__("Tester")
8
+ self.create_chain("""
9
+ You are a Software Tester. Your task is to create comprehensive test cases and execute them on the given code.
10
+
11
+ Code to Test:
12
+ {input}
13
+
14
+ Create test cases that:
15
+ 1. Cover all user stories and acceptance criteria
16
+ 2. Include unit tests, integration tests, and system tests
17
+ 3. Test edge cases and error conditions
18
+ 4. Follow testing best practices
19
+ 5. Include test data and expected results
20
+
21
+ Please provide detailed test cases with clear steps and expected outcomes.
22
+ """)
23
+
24
+ async def create_test_cases(self, code: str) -> Dict[str, Any]:
25
+ """Create test cases for the given code"""
26
+ result = await self.process({"input": code})
27
+
28
+ # Store the test cases in the database
29
+ db.store_artifact(
30
+ "test_cases",
31
+ result,
32
+ {
33
+ "type": "test_case",
34
+ "source": "tester",
35
+ "status": "created"
36
+ }
37
+ )
38
+
39
+ return {
40
+ "status": "success",
41
+ "test_cases": result,
42
+ "message": "Test cases created successfully"
43
+ }
44
+
45
+ async def execute_tests(self, code: str, test_cases: str) -> Dict[str, Any]:
46
+ """Execute test cases on the given code"""
47
+ result = await self.process({
48
+ "input": f"Code:\n{code}\n\nTest Cases:\n{test_cases}"
49
+ })
50
+
51
+ # Store the test results in the database
52
+ db.store_artifact(
53
+ "test_results",
54
+ result,
55
+ {
56
+ "type": "test_result",
57
+ "source": "tester",
58
+ "status": "executed"
59
+ }
60
+ )
61
+
62
+ return {
63
+ "status": "success",
64
+ "test_results": result,
65
+ "message": "Tests executed successfully"
66
+ }
api/__pycache__/main.cpython-310.pyc ADDED
Binary file (1.68 kB). View file
 
app.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import asyncio
3
+ from agents.project_manager import ProjectManagerAgent
4
+ import json
5
+ from typing import Dict, Any
6
+
7
+ # Initialize the project manager
8
+ project_manager = ProjectManagerAgent()
9
+
10
+ # Set page config
11
+ st.set_page_config(
12
+ page_title="AI Development Pod",
13
+ page_icon="🤖",
14
+ layout="wide"
15
+ )
16
+
17
+ # Custom CSS
18
+ st.markdown("""
19
+ <style>
20
+ .main {
21
+ padding: 2rem;
22
+ }
23
+ .stButton>button {
24
+ width: 100%;
25
+ }
26
+ .stTextArea>div>div>textarea {
27
+ height: 200px;
28
+ }
29
+ .progress-bar {
30
+ height: 10px;
31
+ background-color: #f0f0f0;
32
+ border-radius: 5px;
33
+ margin: 10px 0;
34
+ }
35
+ .progress-bar-fill {
36
+ height: 100%;
37
+ background-color: #4CAF50;
38
+ border-radius: 5px;
39
+ transition: width 0.3s ease-in-out;
40
+ }
41
+ </style>
42
+ """, unsafe_allow_html=True)
43
+
44
+ # Title and description
45
+ st.title("🤖 AI Development Pod")
46
+ st.markdown("""
47
+ This is an AI-powered virtual development team that can handle your software project from requirements to testing.
48
+ Simply enter your project requirements and let the AI team do the rest!
49
+ """)
50
+
51
+ # Sidebar for navigation
52
+ st.sidebar.title("Navigation")
53
+ page = st.sidebar.radio("Go to", ["Start Project", "Project Status", "Quality Check"])
54
+
55
+ def display_progress(messages: list):
56
+ """Display progress based on workflow messages"""
57
+ steps = {
58
+ "User stories created successfully": 20,
59
+ "Design created successfully": 40,
60
+ "Code generated successfully": 60,
61
+ "Test cases created successfully": 80,
62
+ "Tests executed successfully": 100
63
+ }
64
+
65
+ current_progress = 0
66
+ for message in messages:
67
+ if message in steps:
68
+ current_progress = max(current_progress, steps[message])
69
+
70
+ st.markdown(f"""
71
+ <div class="progress-bar">
72
+ <div class="progress-bar-fill" style="width: {current_progress}%"></div>
73
+ </div>
74
+ <p style="text-align: center;">{current_progress}% Complete</p>
75
+ """, unsafe_allow_html=True)
76
+
77
+ for message in messages:
78
+ st.info(message)
79
+
80
+ async def run_project(requirements: str) -> Dict[str, Any]:
81
+ """Run the project workflow"""
82
+ return await project_manager.start_project(requirements)
83
+
84
+ async def get_project_status() -> Dict[str, Any]:
85
+ """Get the project status"""
86
+ return await project_manager.get_status()
87
+
88
+ async def run_quality_check() -> Dict[str, Any]:
89
+ """Run the quality check"""
90
+ return await project_manager.check_quality()
91
+
92
+ if page == "Start Project":
93
+ st.header("Start New Project")
94
+
95
+ # Project requirements input
96
+ requirements = st.text_area(
97
+ "Enter your project requirements:",
98
+ placeholder="Describe your project requirements in detail...",
99
+ height=200
100
+ )
101
+
102
+ if st.button("Start Project"):
103
+ if requirements:
104
+ with st.spinner("Processing your project..."):
105
+ # Run the async function
106
+ result = asyncio.run(run_project(requirements))
107
+
108
+ # Display progress
109
+ display_progress(result["messages"])
110
+
111
+ # Display results in tabs
112
+ tab1, tab2, tab3, tab4 = st.tabs(["User Stories", "Design", "Code", "Test Results"])
113
+
114
+ with tab1:
115
+ st.subheader("User Stories")
116
+ st.markdown(result["user_stories"])
117
+
118
+ with tab2:
119
+ st.subheader("Design")
120
+ st.markdown(result["design"])
121
+
122
+ with tab3:
123
+ st.subheader("Generated Code")
124
+ st.code(result["code"], language="python")
125
+
126
+ with tab4:
127
+ st.subheader("Test Results")
128
+ st.markdown(result["test_results"])
129
+ else:
130
+ st.error("Please enter project requirements")
131
+
132
+ elif page == "Project Status":
133
+ st.header("Project Status")
134
+
135
+ if st.button("Check Status"):
136
+ with st.spinner("Getting project status..."):
137
+ status = asyncio.run(get_project_status())
138
+
139
+ # Display status metrics
140
+ col1, col2, col3, col4 = st.columns(4)
141
+
142
+ with col1:
143
+ st.metric("User Stories", status["data"]["user_stories"])
144
+ with col2:
145
+ st.metric("Designs", status["data"]["designs"])
146
+ with col3:
147
+ st.metric("Code Files", status["data"]["code"])
148
+ with col4:
149
+ st.metric("Test Results", status["data"]["test_results"])
150
+
151
+ elif page == "Quality Check":
152
+ st.header("Quality Check")
153
+
154
+ if st.button("Run Quality Check"):
155
+ with st.spinner("Running quality check..."):
156
+ quality_report = asyncio.run(run_quality_check())
157
+
158
+ st.subheader("Quality Report")
159
+ st.markdown(quality_report["quality_report"])
160
+
161
+ # Footer
162
+ st.markdown("---")
163
+ st.markdown("""
164
+ <div style='text-align: center'>
165
+ <p>AI Development Pod - Powered by Groq's Gemma2-9b-it and LangGraph</p>
166
+ </div>
167
+ """, unsafe_allow_html=True)
chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8146ecc3e4c3a36ea9b3edc3778630c452f483990ec942d38e8006f4661e430
3
+ size 16760000
chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f1e924efbb5e1af5201e3fbab86a97f5c195c311abe651eeec525884e5e449
3
+ size 100
chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6bbf80e711a9a4d340bd13f1144da633010eb9d4088769ff99715e83ff21386
3
+ size 40000
chroma_db/0895c0fd-aea2-4db2-9ea7-55fff1798415/link_lists.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
3
+ size 0
chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8146ecc3e4c3a36ea9b3edc3778630c452f483990ec942d38e8006f4661e430
3
+ size 16760000
chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f1e924efbb5e1af5201e3fbab86a97f5c195c311abe651eeec525884e5e449
3
+ size 100
chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19cd81fc650082cb4a5ef6a84ce1d62be39af6da611b317c12e9ebdd8c3fd603
3
+ size 40000
chroma_db/14bf569c-0412-405e-93d7-9bb5e922d766/link_lists.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
3
+ size 0
chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8146ecc3e4c3a36ea9b3edc3778630c452f483990ec942d38e8006f4661e430
3
+ size 16760000
chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f1e924efbb5e1af5201e3fbab86a97f5c195c311abe651eeec525884e5e449
3
+ size 100
chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75312a06f8f6d7e8829ef723c70b4ce7aa48d66f2b4b8ba91ed0d6e82889c107
3
+ size 40000
chroma_db/7bd06384-5d74-44db-8b6f-08b881d638bb/link_lists.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
3
+ size 0
chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8146ecc3e4c3a36ea9b3edc3778630c452f483990ec942d38e8006f4661e430
3
+ size 16760000
chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f1e924efbb5e1af5201e3fbab86a97f5c195c311abe651eeec525884e5e449
3
+ size 100
chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdcfb6f1f26aa69981243c6b7f28102259bfd257a0d4f46ca0ad930da0e247e9
3
+ size 40000
chroma_db/a2f05e8f-89be-4d76-83a9-7a93d98352c3/link_lists.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
3
+ size 0
chroma_db/chroma.sqlite3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05db23910207a92cde2e7f64cb2269ce331113916513eee4eefd22e989a51345
3
+ size 1581056
chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8146ecc3e4c3a36ea9b3edc3778630c452f483990ec942d38e8006f4661e430
3
+ size 16760000
chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18f1e924efbb5e1af5201e3fbab86a97f5c195c311abe651eeec525884e5e449
3
+ size 100
chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:378f45a28e48d022520cb763bf98854799329f959f17c44a79ba7198a8f6d1bb
3
+ size 40000
chroma_db/d08fb65a-aa5f-4895-9fa1-1c9781b3421e/link_lists.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
3
+ size 0
core/__pycache__/base_agent.cpython-310.pyc ADDED
Binary file (1.71 kB). View file
 
core/__pycache__/base_agent.cpython-311.pyc ADDED
Binary file (2.56 kB). View file
 
core/__pycache__/base_agent.cpython-313.pyc ADDED
Binary file (2.36 kB). View file
 
core/__pycache__/config.cpython-310.pyc ADDED
Binary file (903 Bytes). View file
 
core/__pycache__/config.cpython-311.pyc ADDED
Binary file (1.35 kB). View file