diff --git a/pilot/helpers/generate_specs.py b/pilot/helpers/generate_specs.py index c10b0bbe50..e7f92aa8a0 100644 --- a/pilot/helpers/generate_specs.py +++ b/pilot/helpers/generate_specs.py @@ -196,6 +196,7 @@ def get_file_description(node, project_structure): 'project_path': node['path'], 'project_structure': project_structure, 'children': node['children'], + 'node': node, 'is_root': True, }, 'gpt-4-turbo') diff --git a/pilot/prompts/spec_autogen/get_file_description.prompt b/pilot/prompts/spec_autogen/get_file_description.prompt index c29a7b4485..aaeffb91ad 100644 --- a/pilot/prompts/spec_autogen/get_file_description.prompt +++ b/pilot/prompts/spec_autogen/get_file_description.prompt @@ -8,4 +8,4 @@ I want you to read the file `{{ file_path }}` that has the following content: {{ file_content }} ``` -If you had to guess what does this file do without having a context of the entire app of which it's a part of, what would you say that this file is meant for? +If you had to guess what does this file do without having a context of the entire app of which it's a part of, what would you say that this file is meant for? What are the features that this file supports? diff --git a/pilot/prompts/spec_autogen/get_folder_description.prompt b/pilot/prompts/spec_autogen/get_folder_description.prompt index fefa43b44f..7bc87ca428 100644 --- a/pilot/prompts/spec_autogen/get_folder_description.prompt +++ b/pilot/prompts/spec_autogen/get_folder_description.prompt @@ -14,4 +14,4 @@ The description for the {{ child['type'] }} {{ child['name'] }} is: {% endfor %} ``` -If you had to guess what does this folder do without having a context of the entire app of which it's a part of, what would you say that this folder is meant for? +If you had to guess what does this file do without having a context of the entire app of which it's a part of, what would you say that this file is meant for? What are the features that this file supports? diff --git a/pilot/prompts/spec_autogen/get_project_specs.prompt b/pilot/prompts/spec_autogen/get_project_specs.prompt index e9edf5e18a..390bbd65ae 100644 --- a/pilot/prompts/spec_autogen/get_project_specs.prompt +++ b/pilot/prompts/spec_autogen/get_project_specs.prompt @@ -3,15 +3,24 @@ I have a project with the following folders and files: {{ project_structure }} ``` -Here are the descriptions of all files and folders within `{{ folder_path }}`: -``` -{% for child in children %} -{% if child['description'] != None -%} -The description for the {{ child['type'] }} {{ child['name'] }} is: -{{ child['description'] }} -{%- endif %} +Here are the descriptions of all files and folders within `{{ folder_path }}`. +{% macro print_element(element) -%} + {%- if element['description'] != None -%} +The description for the {{ element['type'] }} `{{ element['path'] }}` is: +{{ element['description'] }} +-------------- -{% endfor %} -``` +{% endif -%} + {%- if element.children -%} + {%- for child in element.children -%} + {{ print_element(child) }} + {%- endfor -%} + {%- endif -%} +{%- endmacro -%} + +{%- for element in node.children -%} + {{ print_element(element) }} + +{%- endfor -%} Tell me, how can the user use this application?