Implemented getting development plan + outline for AgentConvo class

This commit is contained in:
Zvonimir Sabljic
2023-07-31 10:01:20 +02:00
parent 05b59c7d7c
commit b5a5297ec5
4 changed files with 62 additions and 7 deletions

View File

@@ -73,4 +73,43 @@ COMMANDS_TO_RUN = {
'functions': {
'process_commands': run_commands
},
}
DEVELOPMENT_PLAN = {
'definitions': [{
'name': 'implement_development_plan',
'description': 'Implements the development plan.',
'parameters': {
'type': 'object',
"properties": {
"plan": {
"type": "array",
"description": 'List of development tasks that need to be done to implement the entire plan.',
"items": {
"type": "object",
'description': 'Development task that needs to be done to implement the entire plan.',
'properties': {
'task_description': {
'type': 'string',
'description': 'Description of the development task that needs to be done to implement the entire plan.',
},
'programmatic_goal': {
'type': 'string',
'description': 'programmatic goal that will determine if a task can be marked as done from a programmatic perspective (this will result in an automated test that is run before the task is sent to you for a review)',
},
'user_review_goal': {
'type': 'string',
'description': 'user-review goal that will determine if a task is done or not but from a user perspective since it will be reviewed by a human',
}
},
'required': ['command', 'timeout'],
},
},
},
"required": ['plan'],
},
}],
'functions': {
'implement_development_plan': lambda plan: (plan, None)
},
}

View File

@@ -36,12 +36,12 @@ if __name__ == "__main__":
architecture, architecture_messages = get_architecture(high_level_summary, user_stories, user_tasks, args)
development_plan, development_plan_messages = create_development_plan(user_stories, user_tasks, architecture, args)
# TODO REMOVE THIS
architecture = architecture.split('\n')
# TODO END
development_plan = create_development_plan(high_level_summary, user_stories, user_tasks, architecture, args)
set_up_environment(architecture, args);
start_development(user_stories, user_tasks, architecture, args)

View File

@@ -2,7 +2,7 @@ You are working in a software development agency and a project manager and softw
Here is a high level description of Euclid:
```
{{ prompt }}
{{ app_summary }}
```
Here are some additional questions and answers to clarify the apps description:

View File

@@ -1,11 +1,12 @@
import json
from termcolor import colored
from helpers.AgentConvo import AgentConvo
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 const.function_calls import FILTER_OS_TECHNOLOGIES, COMMANDS_TO_RUN
from const.function_calls import FILTER_OS_TECHNOLOGIES, DEVELOPMENT_PLAN
from const.code_execution import MAX_COMMAND_DEBUG_TRIES
from utils.utils import get_os_info
from helpers.cli import execute_command
@@ -155,9 +156,9 @@ def set_up_environment(technologies, args):
# ENVIRONMENT SETUP END
def create_development_plan(user_stories, user_tasks, technologies_to_use, args):
def create_development_plan(high_level_summary, user_stories, user_tasks, technologies_to_use, args):
current_step = 'development_planning'
role = find_role_from_step(current_step)
convo_development_plan = AgentConvo(current_step)
steps = get_progress_steps(args['app_id'], current_step)
if steps and not execute_step(args['step'], current_step):
@@ -177,8 +178,23 @@ def create_development_plan(user_stories, user_tasks, technologies_to_use, args)
print(colored(f"Starting to create the action plan for development...\n", "green"))
logger.info(f"Starting to create the action plan for development...")
# TODO add clarifications
development_plan = convo_development_plan.send_message('development/plan.prompt',
{
"app_summary": high_level_summary,
"clarification": [],
"user_stories": user_stories.split('\n\n'),
"user_tasks": user_tasks.split('\n\n'),
"technologies": technologies_to_use
}, DEVELOPMENT_PLAN)
pass
logger.info('Plan for development is created.')
save_progress(args['app_id'], current_step, {
"development_plan": development_plan, "app_data": generate_app_data(args)
})
return development_plan
def start_development(user_stories, user_tasks, technologies_to_use, args):
pass