mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +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 = {
|
FILTER_OS_TECHNOLOGIES = {
|
||||||
'definitions': [
|
'definitions': [
|
||||||
return_array_from_prompt('os specific technologies', 'os specific technology', 'technologies')
|
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)
|
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)
|
development_plan = create_development_plan(high_level_summary, user_stories, user_tasks, architecture, args)
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
# user_stories.py
|
# user_stories.py
|
||||||
import json
|
import json
|
||||||
from termcolor import colored
|
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 database.database import save_progress, get_progress_steps
|
||||||
from logger.logger import logger
|
from logger.logger import logger
|
||||||
from prompts.prompts import get_additional_info_from_user, execute_chat_prompt
|
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):
|
def get_architecture(high_level_summary, user_stories, user_tasks, args):
|
||||||
current_step = 'architecture'
|
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
|
# 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)
|
steps = get_progress_steps(args['app_id'], current_step)
|
||||||
if steps and not execute_step(args['step'], 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"))
|
print(colored(f"Planning project architecture...\n", "green"))
|
||||||
logger.info(f"Planning project architecture...")
|
logger.info(f"Planning project architecture...")
|
||||||
|
|
||||||
architecture, architecture_messages = execute_chat_prompt('architecture/technologies.prompt',
|
architecture = convo_architecture.send_message('architecture/technologies.prompt',
|
||||||
{'prompt': high_level_summary,
|
{'prompt': high_level_summary,
|
||||||
'user_stories': user_stories,
|
'user_stories': user_stories,
|
||||||
'user_tasks': user_tasks,
|
'user_tasks': user_tasks,
|
||||||
'app_type': args['app_type']},
|
'app_type': args['app_type']}, ARCHITECTURE)
|
||||||
current_step)
|
|
||||||
|
|
||||||
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}")
|
logger.info(f"Final architecture: {architecture}")
|
||||||
|
|
||||||
save_progress(args['app_id'], current_step, {
|
save_progress(args['app_id'], current_step, {
|
||||||
"messages": architecture_messages,
|
"messages": convo_architecture.get_messages(),
|
||||||
"architecture": architecture,
|
"architecture": architecture,
|
||||||
"app_data": generate_app_data(args)
|
"app_data": generate_app_data(args)
|
||||||
})
|
})
|
||||||
|
|
||||||
return architecture, architecture_messages
|
return architecture
|
||||||
# ARCHITECTURE END
|
# ARCHITECTURE END
|
||||||
|
|||||||
Reference in New Issue
Block a user