Improved spec prompt

This commit is contained in:
Zvonimir Sabljic
2024-04-28 15:33:53 -07:00
parent 44ee3f950b
commit df9233ebfe
4 changed files with 21 additions and 11 deletions

View File

@@ -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')

View File

@@ -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?

View File

@@ -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?

View File

@@ -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?