mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-31 16:40:03 +01:00
forward messages through steps
This commit is contained in:
@@ -129,7 +129,6 @@ def save_progress(app_id, step, data):
|
||||
conn.close()
|
||||
|
||||
|
||||
|
||||
def get_apps_by_id(app_id):
|
||||
conn = create_connection()
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -9,6 +9,7 @@ from logger.logger import logger
|
||||
from steps.project_description.project_description import get_project_description
|
||||
from steps.user_stories.user_stories import get_user_stories
|
||||
from steps.user_tasks.user_tasks import get_user_tasks
|
||||
from steps.architecture.architecture import get_architecture
|
||||
|
||||
|
||||
def init():
|
||||
@@ -24,12 +25,12 @@ def init():
|
||||
if __name__ == "__main__":
|
||||
args = init()
|
||||
|
||||
high_level_summary = get_project_description(args)
|
||||
high_level_summary, high_level_messages = get_project_description(args)
|
||||
|
||||
user_stories = get_user_stories(high_level_summary, args)
|
||||
user_stories, user_stories_messages = get_user_stories(high_level_summary, args)
|
||||
|
||||
user_tasks = get_user_tasks(user_stories, args)
|
||||
user_tasks, user_tasks_messages = get_user_tasks(user_stories, args)
|
||||
|
||||
# get architecture plan
|
||||
architecture, architecture_messages = get_architecture(high_level_summary, user_stories, user_tasks, args)
|
||||
|
||||
# development
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
You are working in a software development agency and a project manager approached you telling you that you're assigned to work on a new project. You are working on a web app called Euclid and you need to create specifications on what technologies should be used in this project.
|
||||
You are working in a software development agency and a project manager approached you telling you that you're assigned to work on a new project. You are working on a {{app_type}} called Euclid and you need to create specifications on what technologies should be used in this project.
|
||||
|
||||
Here is a high level description of Euclid:
|
||||
```
|
||||
|
||||
49
euclid/steps/architecture/architecture.py
Normal file
49
euclid/steps/architecture/architecture.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# user_stories.py
|
||||
import json
|
||||
from termcolor import colored
|
||||
|
||||
from utils.utils import execute_step, split_into_bullets, find_role_from_step, generate_app_data
|
||||
from database.database import save_progress, get_progress_steps
|
||||
from logger.logger import logger
|
||||
from prompts.prompts import get_additional_info_from_user, execute_chat_prompt
|
||||
|
||||
|
||||
def get_architecture(high_level_summary, user_stories, user_tasks, args):
|
||||
current_step = 'architecture'
|
||||
role = find_role_from_step(current_step)
|
||||
# If this app_id already did this step, just get all data from DB and don't ask user again
|
||||
steps = get_progress_steps(args['app_id'], current_step)
|
||||
if steps and not execute_step(args['step'], current_step):
|
||||
first_step = steps[0]
|
||||
data = json.loads(first_step['data'])
|
||||
|
||||
architecture = data.get('architecture')
|
||||
|
||||
message = f"Architecture already done for this app_id: {args['app_id']}. Moving to next step..."
|
||||
print(colored(message, "green"))
|
||||
logger.info(message)
|
||||
return architecture, data.get('messages')
|
||||
|
||||
# ARCHITECTURE
|
||||
print(colored(f"Planning project architecture...\n", "green"))
|
||||
logger.info(f"Planning project architecture...")
|
||||
|
||||
architecture, architecture_messages = execute_chat_prompt('architecture/technologies.prompt',
|
||||
{'prompt': high_level_summary,
|
||||
'user_stories': user_stories,
|
||||
'user_tasks': user_tasks,
|
||||
'app_type': args['app_type']},
|
||||
current_step)
|
||||
|
||||
architecture = get_additional_info_from_user(split_into_bullets(architecture), role)
|
||||
|
||||
logger.info(f"Final architecture: {architecture}")
|
||||
|
||||
save_progress(args['app_id'], current_step, {
|
||||
"messages": architecture_messages,
|
||||
"architecture": architecture,
|
||||
"app_data": generate_app_data(args)
|
||||
})
|
||||
|
||||
return architecture, architecture_messages
|
||||
# ARCHITECTURE END
|
||||
@@ -8,6 +8,7 @@ from utils.utils import execute_step, generate_app_data
|
||||
from prompts.prompts import ask_for_app_type, ask_for_main_app_definition, get_additional_info_from_openai, \
|
||||
generate_messages_from_description, execute_chat_prompt
|
||||
|
||||
|
||||
def get_project_description(args):
|
||||
current_step = 'project_description'
|
||||
# If this app_id already did this step, just get all data from DB and don't ask user again
|
||||
@@ -24,7 +25,7 @@ def get_project_description(args):
|
||||
print(colored(message, "green"))
|
||||
logger.info(message)
|
||||
|
||||
return summary
|
||||
return summary, data.get('messages')
|
||||
|
||||
# PROJECT DESCRIPTION
|
||||
args['app_type'] = ask_for_app_type()
|
||||
@@ -42,7 +43,8 @@ def get_project_description(args):
|
||||
current_step)
|
||||
|
||||
save_progress(args['app_id'], current_step,
|
||||
{"messages": high_level_messages, "summary": high_level_summary, "app_data": generate_app_data(args)})
|
||||
{"messages": high_level_messages, "summary": high_level_summary, "app_data": generate_app_data(args)
|
||||
})
|
||||
|
||||
return high_level_summary
|
||||
return high_level_summary, high_level_messages
|
||||
# PROJECT DESCRIPTION END
|
||||
|
||||
@@ -25,7 +25,7 @@ def get_user_stories(summary, args):
|
||||
message = f"User stories already done for this app_id: {args['app_id']}. Moving to next step..."
|
||||
print(colored(message, "green"))
|
||||
logger.info(message)
|
||||
return user_stories
|
||||
return user_stories, data.get('messages')
|
||||
|
||||
# USER STORIES
|
||||
print(colored(f"Generating user stories...\n", "green"))
|
||||
@@ -40,7 +40,9 @@ def get_user_stories(summary, args):
|
||||
|
||||
logger.info(f"Final user stories: {user_stories}")
|
||||
|
||||
save_progress(args['app_id'], current_step, {"user_stories": user_stories, "app_data": generate_app_data(args)})
|
||||
save_progress(args['app_id'], current_step, {
|
||||
"messages": user_stories_messages, "user_stories": user_stories, "app_data": generate_app_data(args)
|
||||
})
|
||||
|
||||
return user_stories
|
||||
return user_stories, user_stories_messages
|
||||
# USER STORIES END
|
||||
@@ -25,7 +25,7 @@ def get_user_tasks(summary, args):
|
||||
message = f"User tasks already done for this app_id: {args['app_id']}. Moving to next step..."
|
||||
print(colored(message, "green"))
|
||||
logger.info(message)
|
||||
return summary
|
||||
return summary, data.get('messages')
|
||||
|
||||
# USER TASKS
|
||||
print(colored(f"Generating user tasks...\n", "green"))
|
||||
@@ -40,7 +40,9 @@ def get_user_tasks(summary, args):
|
||||
|
||||
logger.info(f"Final user tasks: {user_tasks}")
|
||||
|
||||
save_progress(args['app_id'], current_step, {"user_tasks": user_tasks, "app_data": generate_app_data(args)})
|
||||
save_progress(args['app_id'], current_step, {
|
||||
"messages": user_tasks_messages,"user_tasks": user_tasks, "app_data": generate_app_data(args)
|
||||
})
|
||||
|
||||
return user_tasks
|
||||
return user_tasks, user_tasks_messages
|
||||
# USER TASKS END
|
||||
Reference in New Issue
Block a user