mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-02 01:16:09 +01:00
Refactored getting the architecture to use AgentConvo class
This commit is contained in:
@@ -48,6 +48,15 @@ USER_TASKS = {
|
||||
},
|
||||
}
|
||||
|
||||
ARCHITECTURE = {
|
||||
'definitions': [
|
||||
return_array_from_prompt('technologies', 'technology', 'technologies')
|
||||
],
|
||||
'functions': {
|
||||
'process_technologies': lambda technologies: technologies
|
||||
},
|
||||
}
|
||||
|
||||
FILTER_OS_TECHNOLOGIES = {
|
||||
'definitions': [
|
||||
return_array_from_prompt('os specific technologies', 'os specific technology', 'technologies')
|
||||
|
||||
@@ -34,7 +34,7 @@ if __name__ == "__main__":
|
||||
|
||||
user_tasks, user_tasks_messages = get_user_tasks(user_stories_messages, args)
|
||||
|
||||
architecture, architecture_messages = get_architecture(high_level_summary, user_stories, user_tasks, args)
|
||||
architecture = get_architecture(high_level_summary, user_stories, user_tasks, args)
|
||||
|
||||
development_plan = create_development_plan(high_level_summary, user_stories, user_tasks, architecture, args)
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
# user_stories.py
|
||||
import json
|
||||
from termcolor import colored
|
||||
from const.function_calls import ARCHITECTURE
|
||||
|
||||
from utils.utils import execute_step, split_into_bullets, find_role_from_step, generate_app_data
|
||||
from utils.utils import execute_step, 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
|
||||
from helpers.AgentConvo import AgentConvo
|
||||
|
||||
|
||||
def get_architecture(high_level_summary, user_stories, user_tasks, args):
|
||||
current_step = 'architecture'
|
||||
role = find_role_from_step(current_step)
|
||||
convo_architecture = AgentConvo(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):
|
||||
@@ -28,22 +31,21 @@ def get_architecture(high_level_summary, user_stories, user_tasks, args):
|
||||
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 = convo_architecture.send_message('architecture/technologies.prompt',
|
||||
{'prompt': high_level_summary,
|
||||
'user_stories': user_stories,
|
||||
'user_tasks': user_tasks,
|
||||
'app_type': args['app_type']}, ARCHITECTURE)
|
||||
|
||||
architecture = get_additional_info_from_user(split_into_bullets(architecture), role)
|
||||
architecture = get_additional_info_from_user(architecture, 'architect')
|
||||
|
||||
logger.info(f"Final architecture: {architecture}")
|
||||
|
||||
save_progress(args['app_id'], current_step, {
|
||||
"messages": architecture_messages,
|
||||
"messages": convo_architecture.get_messages(),
|
||||
"architecture": architecture,
|
||||
"app_data": generate_app_data(args)
|
||||
})
|
||||
|
||||
return architecture, architecture_messages
|
||||
return architecture
|
||||
# ARCHITECTURE END
|
||||
|
||||
Reference in New Issue
Block a user