Spaces:
Runtime error
Runtime error
Upload 5 files
Browse files
agents/project_manager_agent.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
import torch
|
3 |
+
from langchain_core.messages import AIMessage
|
4 |
+
|
5 |
+
MODEL_REPO = "Rahul-8799/project_manager_gemma3"
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
9 |
+
MODEL_REPO,
|
10 |
+
torch_dtype=torch.float16,
|
11 |
+
device_map="auto"
|
12 |
+
)
|
13 |
+
|
14 |
+
|
15 |
+
def run(state: dict) -> dict:
|
16 |
+
"""Creates project plan based on product requirements."""
|
17 |
+
messages = state["messages"]
|
18 |
+
prompt = messages[-1].content
|
19 |
+
|
20 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
|
21 |
+
output_ids = model.generate(input_ids, max_new_tokens=3000)
|
22 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
23 |
+
|
24 |
+
return {
|
25 |
+
"messages": [AIMessage(content=output)],
|
26 |
+
"chat_log": state["chat_log"] + [{"role": "Project Manager", "content": output}],
|
27 |
+
"proj_output": output,
|
28 |
+
}
|
agents/quality_assurance_agent.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
import torch
|
3 |
+
from langchain_core.messages import AIMessage
|
4 |
+
|
5 |
+
MODEL_REPO = "Rahul-8799/quality_assurance_stablecode"
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
9 |
+
MODEL_REPO,
|
10 |
+
torch_dtype=torch.float16,
|
11 |
+
device_map="auto"
|
12 |
+
)
|
13 |
+
|
14 |
+
def run(state: dict) -> dict:
|
15 |
+
"""Reviews UI/UX implementation and suggests improvements for better user experience"""
|
16 |
+
messages = state["messages"]
|
17 |
+
prompt = messages[-1].content
|
18 |
+
|
19 |
+
# Enhance the prompt with UI/UX quality checks
|
20 |
+
enhanced_prompt = f"""
|
21 |
+
Review the UI implementation and check for:
|
22 |
+
1. Proper spacing and alignment
|
23 |
+
2. Consistent styling and theming
|
24 |
+
3. Responsive design implementation
|
25 |
+
4. Accessibility compliance
|
26 |
+
5. Visual hierarchy
|
27 |
+
6. Component reusability
|
28 |
+
7. Performance optimization
|
29 |
+
8. Cross-browser compatibility
|
30 |
+
9. Mobile responsiveness
|
31 |
+
10. User interaction patterns
|
32 |
+
|
33 |
+
Original code: {prompt}
|
34 |
+
"""
|
35 |
+
|
36 |
+
input_ids = tokenizer(enhanced_prompt, return_tensors="pt").input_ids.to(model.device)
|
37 |
+
output_ids = model.generate(input_ids, max_new_tokens=3000)
|
38 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
39 |
+
|
40 |
+
return {
|
41 |
+
"messages": [AIMessage(content=output)],
|
42 |
+
"chat_log": state["chat_log"] + [{"role": "Quality Assurance", "content": output}],
|
43 |
+
"qa_output": output,
|
44 |
+
}
|
agents/software_architect_agent.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
import torch
|
3 |
+
from langchain_core.messages import AIMessage
|
4 |
+
|
5 |
+
MODEL_REPO = "Rahul-8799/software_architect_command_r"
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
9 |
+
MODEL_REPO,
|
10 |
+
torch_dtype=torch.float16,
|
11 |
+
device_map="auto"
|
12 |
+
)
|
13 |
+
|
14 |
+
def run(state: dict) -> dict:
|
15 |
+
"""Software Architect designs overall system architecture"""
|
16 |
+
messages = state["messages"]
|
17 |
+
prompt = messages[-1].content
|
18 |
+
|
19 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
|
20 |
+
output_ids = model.generate(input_ids, max_new_tokens=3000)
|
21 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
22 |
+
|
23 |
+
return {
|
24 |
+
"messages": [AIMessage(content=output)],
|
25 |
+
"chat_log": state["chat_log"] + [{"role": "Software Architect", "content": output}],
|
26 |
+
"arch_output": output,
|
27 |
+
}
|
agents/software_engineer_agent.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
import torch
|
3 |
+
from langchain_core.messages import AIMessage
|
4 |
+
|
5 |
+
MODEL_REPO = "Rahul-8799/software_engineer_mellum"
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
9 |
+
MODEL_REPO,
|
10 |
+
torch_dtype=torch.float16,
|
11 |
+
device_map="auto"
|
12 |
+
)
|
13 |
+
|
14 |
+
def run(state: dict) -> dict:
|
15 |
+
"""Software Engineer generates clean, modern UI code using best practices"""
|
16 |
+
messages = state["messages"]
|
17 |
+
prompt = messages[-1].content
|
18 |
+
|
19 |
+
# Enhance the prompt with UI implementation guidelines
|
20 |
+
enhanced_prompt = f"""
|
21 |
+
Generate modern, clean UI code following these guidelines:
|
22 |
+
1. Use Tailwind CSS for styling (recommended for consistent spacing and responsive design)
|
23 |
+
2. Implement proper semantic HTML structure
|
24 |
+
3. Use CSS Grid and Flexbox for layouts
|
25 |
+
4. Add proper ARIA labels for accessibility
|
26 |
+
5. Implement responsive breakpoints
|
27 |
+
6. Use CSS variables for consistent theming
|
28 |
+
7. Add proper error handling and loading states
|
29 |
+
8. Implement proper component structure
|
30 |
+
|
31 |
+
Original requirements: {prompt}
|
32 |
+
"""
|
33 |
+
|
34 |
+
input_ids = tokenizer(enhanced_prompt, return_tensors="pt").input_ids.to(model.device)
|
35 |
+
output_ids = model.generate(input_ids, max_new_tokens=3000)
|
36 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
37 |
+
|
38 |
+
return {
|
39 |
+
"messages": [AIMessage(content=output)],
|
40 |
+
"chat_log": state["chat_log"] + [{"role": "Software Engineer", "content": output}],
|
41 |
+
"dev_output": output,
|
42 |
+
}
|
agents/ui_designer_agent.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
+
import torch
|
3 |
+
from langchain_core.messages import AIMessage
|
4 |
+
|
5 |
+
MODEL_REPO = "Rahul-8799/ui_designer_mistral" # You'll need to fine-tune this model
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
9 |
+
MODEL_REPO,
|
10 |
+
torch_dtype=torch.float16,
|
11 |
+
device_map="auto"
|
12 |
+
)
|
13 |
+
|
14 |
+
def run(state: dict) -> dict:
|
15 |
+
"""UI Designer creates beautiful and structured UI designs with proper spacing and layout"""
|
16 |
+
messages = state["messages"]
|
17 |
+
prompt = messages[-1].content
|
18 |
+
|
19 |
+
# Enhance the prompt with UI design principles
|
20 |
+
enhanced_prompt = f"""
|
21 |
+
Create a beautiful and well-structured UI design following these principles:
|
22 |
+
1. Use proper spacing and padding (recommended: 1rem/16px for padding, 2rem/32px for margins)
|
23 |
+
2. Implement a consistent color scheme
|
24 |
+
3. Ensure proper hierarchy with clear headings
|
25 |
+
4. Use responsive design principles
|
26 |
+
5. Implement proper grid system
|
27 |
+
6. Add smooth transitions and hover effects
|
28 |
+
7. Ensure proper contrast and readability
|
29 |
+
8. Use modern UI components and patterns
|
30 |
+
|
31 |
+
Original requirements: {prompt}
|
32 |
+
"""
|
33 |
+
|
34 |
+
input_ids = tokenizer(enhanced_prompt, return_tensors="pt").input_ids.to(model.device)
|
35 |
+
output_ids = model.generate(input_ids, max_new_tokens=3000)
|
36 |
+
output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
37 |
+
|
38 |
+
return {
|
39 |
+
"messages": [AIMessage(content=output)],
|
40 |
+
"chat_log": state["chat_log"] + [{"role": "UI Designer", "content": output}],
|
41 |
+
"ui_design_output": output,
|
42 |
+
}
|