Check project complexity and for simple projects force plan to have only 1 task to stop overengineering

This commit is contained in:
LeonOstrez
2024-04-22 14:24:17 +01:00
parent d818006661
commit a4fd791fe4
5 changed files with 23 additions and 5 deletions

View File

@@ -6,9 +6,9 @@ from prompts.prompts import ask_user
from const.messages import AFFIRMATIVE_ANSWERS
from utils.exit import trace_code_event
INITIAL_PROJECT_HOWTO_URL = "https://github.com/Pythagora-io/gpt-pilot/wiki/How-to-write-a-good-initial-project-description"
class SpecWriter(Agent):
def __init__(self, project):
super().__init__('spec_writer', project)
@@ -75,7 +75,6 @@ class SpecWriter(Agent):
return llm_response
def review_spec(self, initial_prompt, spec):
convo = AgentConvo(self, temperature=0)
llm_response = convo.send_message('spec_writer/review_spec.prompt', {
@@ -86,8 +85,18 @@ class SpecWriter(Agent):
return None
return llm_response.strip()
def check_app_complexity(self, initial_prompt):
convo = AgentConvo(self, temperature=0)
llm_response = convo.send_message('spec_writer/app_complexity.prompt', {
"app_summary": initial_prompt,
})
if llm_response == '1':
return False
return True
def create_spec(self, initial_prompt):
if len(initial_prompt) > 1500:
self.project.is_complex_app = self.check_app_complexity(initial_prompt)
if len(initial_prompt) > 1500 or not self.project.is_complex_app:
return initial_prompt
print('', type='verbose', category='agent:spec-writer')

View File

@@ -54,6 +54,7 @@ class TechLead(Agent):
"existing_summary": existing_summary,
"files": self.project.get_all_coded_files(),
"task_type": 'app',
"is_complex_app": self.project.is_complex_app,
}, DEVELOPMENT_PLAN)
self.project.development_plan = llm_response['plan']

View File

@@ -7,4 +7,4 @@ You are working in a software development agency and a project manager and softw
{{ files_list }}{% endif %}
{{ project_tasks }}
{% if is_complex_app %}{{ project_tasks }}{% else %}This is very low complexity app and because of that, you have to create ONLY one task that is sufficient to fully develop this app.{% endif %}

View File

@@ -0,0 +1,8 @@
```
{{ app_summary }}
```
The following is a user prompt for application/software tool they are trying to develop. Determine the complexity of the user's request. Do NOT respond with thoughts, reasoning, explanations or anything similar, return ONLY a numerical representation of the complexity level. Use the following scale:
3 for HIGH_COMPLEXITY
2 for MODERATE_COMPLEXITY
1 for LOW_COMPLEXITY

View File

@@ -5,7 +5,7 @@ Try to avoid the use of Docker, Kubernetes, microservices and single-page app fr
In your work, follow these important rules:
* In your communication with the client, be straightforward, concise, and focused on the task.
* Ask questions ONE BY ONE. This is veryy important, as the client is easily confused. If you were to ask multiple questions the user would probably miss some questions, so remember to always ask the questions one by one
* Ask questions ONE BY ONE. This is very important, as the client is easily confused. If you were to ask multiple questions the user would probably miss some questions, so remember to always ask the questions one by one
* Ask specific questions, taking into account what you already know about the project. For example, don't ask "what features do you need?" or "describe your idea"; instead ask "what is the most important feature?"
* Pay special attention to any documentation or information that the project might require (such as accessing a custom API, etc). Be sure to ask the user to provide information and examples that the developers will need to build the proof-of-concept. You will need to output all of this in the final specification.
* This is a a prototype project, it is important to have small and well-defined scope. If the scope seems to grow too large (beyond a week or two of work for one developer), ask the user if they can simplify the project.