Analyze this project based on the vector store and provide the following information:
1. A JSON format output containing:
a. Project overview, including a brief summary, the main entry point of the project, and a simple description of how to run the project.
b. Key modules or components of the project and their basic functions.
c. A step-by-step guide for understanding the project's architecture and functionality.
2. A DOT language graph representing the project structure and relationships.
3. One module can contain multiple components
For the JSON output:
- Each description should be concise and easy to understand.
- Avoid technical jargon and complex explanations.
- Focus on providing practical, actionable information for a Python beginner.
For the DOT graph:
- Use the dot language to create the graph.
- Annotate the purpose of each edge.
- Use "components: (component description)" to show the main component names.
- Output important functions, variables, and file paths.
- Show the business relationship and business flow between components in detail.
Ensure that:
1. There is no duplication in the output content, and each JSON field contains unique information.
2. The output paths related to files follow the information in the task1_filepath.md.
3. The output includes all the files in the vector database, with no exceptions.
4. The Modules scope must include all code in the file, you must not omit any Modules
5. If the projectArchitectureGuide in the JSON output include a filename, the filename must output link with the module name, e.g., "starting from module x and its file xx to understand xxxxx"
6. Do not leave any ambiguious description, and all steps in the projectArchitectureGuide must have a clear logical connection
Output the information in the following format, please provide both the JSON output and the DOT graph based on the project analysis. Your analysis scope must include all files:
1. JSON output (enclosed in \`\`\`json \`\`\`)
\`\`\`json
{
"projectOverview": {
"summary": "A brief, one-sentence summary of the project.",
"entryPoint": "The main file or script to run the project.",
"howToRun": "A simple, step-by-step guide on how to run the project."
},
"keyModules": {
"ModuleName1": "Basic function of this Module",
"ModuleName2": "Basic function of this Module"
},
"projectArchitectureGuide": [
"Step 1: Description of the first key component and its role",
"Step 2: Explanation of how this component interacts with others",
"Step 3: Description of the next key component and its interactions",
"Step 4: Overview of how data flows between components",
"Step 5: Explanation of the project's overall execution flow",
"Step 6: Guide on how to trace a typical operation through the components",
(more steps as needed)
]
}
\`\`\`
2. DOT graph output (enclosed in \`\`\`dot \`\`\`), must strictly following the few shot
\`\`\`dot
digraph SystemStructure {
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=10]
edge [fontname="Helvetica", fontsize=8, fontcolor=gray30]
// Module 1
subgraph cluster_module1 {
label="Module 1"
style="filled,rounded" // added rounded style
color="#cbe7f2" // light blue
node [color="#e3f2fa"] // slightly lighter blue
M1_Component1 [label=<<b>Component Name 1.1</b><br/><br/>Components description: (description)<br/>Key Functions: (list, must align with the original code)<br/>Key Variables: (list)<br/>Key Files: (path)>]
M1_Component2 [label=<<b>Component Name 1.2</b><br/><br/>Components description: (description)<br/>Key Functions: (list, must align with the original code)<br/>Key Variables: (list)<br/>Key Files: (path)>]
M1_Component1 -> M1_Component2 [label="relation and business flow"]
}
// Module 2
subgraph cluster_module2 {
label="Module 2"
style="filled,rounded" // added rounded style
color="#d3f0d3" // light green
node [color="#eaf7ea"] // slightly lighter green
M2_Component1 [label=<<b>Component Name 2.1</b><br/><br/>Components description: (description)<br/>Key Functions: (list, must align with the original code)<br/>Key Variables: (list)<br/>Key Files: (path)>]
M2_Component2 [label=<<b>Component Name 2.2</b><br/><br/>Components description: (description)<br/>Key Functions: (list, must align with the original code)<br/>Key Variables: (list)<br/>Key Files: (path)>]
M2_Component1 -> M2_Component2 [label="relation and business flow"]
}
// Inter-module relationships
M1_Component1 -> M2_Component1 [label="inter-module relation and business flow"]
// Optional external dependencies
ExternalEntity [label=<<b>External Entity</b><br/>(if applicable)>, shape=ellipse, style=dashed]
M1_Component2 -> ExternalEntity [label="external relation", style=dashed]
}
Generate a local map under the {selectedNode} business component:
1. Using DOT language
2. Annotate the purpose of each edge
3. Output important functions, variables, and file path
digraph component_map {
rankdir=TB;
node [shape=box, style="filled", color="lightblue"];
// main file
main_file [label="Main File\n({selectedNode} description)", shape=folder];
// classes
subgraph cluster_classes {
label = "Classes";
style = filled;
color = lightgrey;
node [style=filled, color=white];
Class1 [label="Class1\n(Description)"];
Class2 [label="Class2\n(Description)"];
// more classes...
}
// functions
subgraph cluster_functions {
label = "Functions";
style = filled;
color = lightgrey;
node [style=filled, color=white];
Function1 [label="Function1()\n(Description)"];
Function2 [label="Function2()\n(Description)"];
// more functions...
}
// important vars
subgraph cluster_variables {
label = "Important Variables";
style = filled;
color = lightgrey;
node [style=filled, color=white];
Var1 [label="Variable1\n(Description)"];
Var2 [label="Variable2\n(Description)"];
// more vars...
}
// relationship connections
main_file -> Class1 [label="defines"];
main_file -> Function1 [label="contains"];
Class1 -> Var1 [label="uses"];
Function1 -> Class2 [label="creates"];
// ... more connections
subgraph cluster_note {
style=filled;
color=lightgrey;
node [style=filled, color=white];
note [label="File path: /path/to/component/file.py", shape=note];
}
}
Analyze the highlighted business flow for {selectedNode} and provide the following information in JSON format:
{
"Component Flow Overview": "A brief overview of the business flow.",
"Role of the Highlighted Component and its flow in the Overall Framework": "Explanation of how this business flow fits into the larger system.",
"Roles of Each Sub Component Under This Component": {
"Component1": "Role and purpose of Component1",
"Component2": "Role and purpose of Component2"
}
Provide the output strictly in this JSON format without any additional text or explanations.
provide the following information in JSON format:
{
"Component Name": "Name of the Selected Component",
"Neighbourhoood Components in the Project level": [
{
"name": "Component Name",
"role": "Description of the neighbourhoood component role in the project level",
"interactions with selected component": "How the selected component interacts with the neighbourhoood component"
]
}
]
}
Provide the output strictly in this JSON format without any additional text or explanations.
Analyze the project, focus on the all above files, and return the following information:
1. JSON format analysis:
\`\`\`json
{
"Overview": "A brief overview of the entire project structure",
"Modules": [
{
"Module": "Module Name:Brief description of the module's purpose",
"classes": [
{
"Class": "ClassName1:Concise description of the class, including its purpose and relationships with other classes, easily understandable by beginners",
},
{
"Class": "ClassName2:Concise description of the class, including its purpose and relationships with other classes, easily understandable by beginners",
},
...
],
"files": [
{
"File": "filename1:Detailed description of the file's contents and purpose, easily understandable by beginners",
},
{
"File": "filename2:Detailed description of the file's contents and purpose, easily understandable by beginners",
},
...
]
}
],
"Relationships": [
"0. This whole project starts from ClassX, and then goes into ClassA.",
"1. ClassA uses ClassB by calling functions X and Y, in order to share data between ClassA and ClassB (e.g., varM, varN). This is to support the (purpose) of why ClassA uses ClassB.",
"2. After ClassA uses ClassB, the results of ClassB will be passed into ClassC, which then...",
"3. ...",
"4. ...",
"5. ...",
"6. ..."
]
}
\`\`\`
Ensure each module description is concise and each file description is detailed and beginner-friendly. The relationships should be presented as a numbered list, starting from 0, describing the flow of the project, interactions between classes, function calls, data sharing, and purposes. Provide the output strictly in this JSON format without any additional text or explanations.
2. Inheritance graph using dot language:
\`\`\`dot
digraph SystemStructure {
rankdir=TB;
ranksep=0.7;
nodesep=0.5;
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=10]
edge [fontname="Helvetica", fontsize=8, fontcolor=gray30, arrowsize=0.7]
// Module 1
subgraph cluster_module1 {
label="Module 1"
style="filled,rounded"
color="#cbe7f2"
node [color="#e3f2fa"]
ClassName1 [label=<<b>ClassName1.Class</b><br/><br/>Class description: (description)<br/>Key Functions: (list)<br/>Key Variables: (list)<br/>File: (path)>]
ClassName2 [label=<<b>ClassName2.Class</b><br/><br/>Class description: (description)<br/>Key Functions: (list)<br/>Key Variables: (list)<br/>File: (path)>]
ClassName1 -> ClassName2 [label="Inheritance: ClassName2 extends ClassName1\\nInherited functions: func1, func2\\nInherited variables: var1, var2\\nPurpose: (description of inheritance purpose)"]
}
// Module 2
subgraph cluster_module2 {
label="Module 2"
style="filled,rounded"
color="#d3f0d3"
node [color="#eaf7ea"]
ClassName3 [label=<<b>ClassName3.Class</b><br/><br/>Class description: (description)<br/>Key Functions: (list)<br/>Key Variables: (list)<br/>File: (path)>]
ClassName4 [label=<<b>ClassName4.Class</b><br/><br/>Class description: (description)<br/>Key Functions: (list)<br/>Key Variables: (list)<br/>File: (path)>]
ClassName3 -> ClassName4 [label="Composition: ClassName3 contains ClassName4\\nUsed functions: func3, func4\\nShared variables: var3, var4\\nPurpose: (description of composition purpose)"]
}
// Inter-module relationships
ClassName2 -> ClassName3 [label="Uses: ClassName2 uses ClassName3\\nCalled functions: func5, func6\\nShared data: var5, var6\\nPurpose: (description of usage purpose)"]
// Optional external dependencies
ExternalClass [label=<<b>ExternalClass</b><br/>(if applicable)>, shape=ellipse, style=dashed]
ClassName4.Class -> ExternalClass [label="Depends on: ClassName4 uses ExternalClass\\nUsed functions: extFunc1, extFunc2\\nShared data: extVar1, extVar2\\nPurpose: (description of dependency purpose)", style=dashed]
}
\`\`\`
Based on the uploaded codebase, generate both the JSON analysis and the inheritance graph following these formats. Ensure that:
1. The information in the dot graph aligns with the JSON.
2. Class names are explicitly shown in the dot graph nodes as "ClassName.Class".
3. Descriptions in the JSON are easily understandable by beginners.
4. Class descriptions in the JSON concisely describe relationships with other classes.
5. The dot graph node design is optimized for universal applicability across most programming languages.
6. Relationships in the dot graph use line breaks if the output is too long.
7. The "Relationships" section in the JSON provides a numbered list (starting from 0) describing the project flow, class interactions, function calls, data sharing, and purposes.
8. your output must cover all the code and file I provided in prompt and vector store
Ensure that the dot graph includes function-level details, specifies inheritance and other relationships between nodes, and includes class names, filenames, key functions, and key variables in each node. For inheritance relationships, specify which key functions and variables are inherited and the purpose of the inheritance.
In this inheritance graph, provide me with the function call flow of the [selected node] as dot file content, keeping the main functions and their call relationships in the graph, while presenting secondary functions or complex call relationships in the form of comments.
{selectedNode}
Output format:
using dot langauge
Example call flow
Explanation of each function in each node
Few-shot example:
digraph GenericClassDiagram {
rankdir=TB;
node [shape=box];
edge [];
// Main classes
BaseInterface;
ConcreteInterface;
HelperMixin;
ConcreteClass;
FallbackClass;
// Main methods
node [shape=ellipse];
mainMethod1;
mainMethod2;
helperMethod1;
fallbackMethod1;
fallbackMethod2;
// Helper methods
helperMethod2;
helperMethod3;
helperMethod4;
helperMethod5;
helperMethod6;
helperMethod7;
helperMethod8;
// Relationships
BaseInterface -> mainMethod1 [label="defines"];
BaseInterface -> mainMethod2 [label="defines"];
BaseInterface -> fallbackMethod1;
BaseInterface -> fallbackMethod2;
ConcreteInterface -> BaseInterface [label="inherits"];
ConcreteInterface -> helperMethod1;
ConcreteInterface -> mainMethod1 [label="implements"];
ConcreteInterface -> mainMethod2 [label="implements"];
ConcreteInterface -> helperMethod2 [style=dotted];
ConcreteInterface -> helperMethod3 [style=dotted];
ConcreteInterface -> helperMethod4 [style=dotted];
ConcreteInterface -> helperMethod5 [style=dotted];
ConcreteInterface -> helperMethod6 [style=dotted];
ConcreteInterface -> helperMethod7 [style=dotted];
ConcreteInterface -> helperMethod8 [style=dotted];
HelperMixin -> ConcreteClass [label="used by"];
ConcreteClass -> FallbackClass [label="base for"];
// Subgraph for mainMethod1
subgraph cluster_mainMethod1 {
label = "mainMethod1 flow";
node [shape=box];
helperMethod1 -> "step 1" -> "step 2";
}
// Subgraph for mainMethod2
subgraph cluster_mainMethod2 {
label = "mainMethod2 flow";
node [shape=box];
"check condition" -> helperMethod8 -> "perform action";
}
// Notes
note1 [shape=note, label="HelperMixin provides\ncommon attributes\nand methods"];
note2 [shape=note, label="FallbackClass is used when\nregular functionality is unavailable"];
note3 [shape=note, label="Helper methods are called\nwithin main methods"];
HelperMixin -> note1 [style=dotted];
FallbackClass -> note2 [style=dotted];
ConcreteInterface -> note3 [style=dotted];
}
Please provide a detailed function call flow diagram for the selected node following this format.
Explain the details for the selcted node {selectedNode}. Provide the output in the following JSON format:
{
"highlightedInheritance": [
{
"name": "Class Overview",
"value": "Brief overview of the Selected Class and its flow"
},
{
"name": "Role of the Class in the Overall CodeBase",
"value": "Description of how this class fits in the overall codebase"
},
{
"name": "Roles of the key functions under this Class",
"value": {
"function1": "Role and purpose of function1",
"function2": "Role and purpose of function2"
// ... more functions as needed
}
}
]
}
Ensure the output is strictly in this JSON format without any additional text or explanations.
Explain the relevant inheritance flow for the selected node {selectedNode}. Provide the output in the following JSON format:
{
"relevantInheritance": [
{
"name": "Class Name",
"key": "inheritance_flow_overview",
"value": "Name of the Selected Class"
}
{
"name": "Neighbourhoood Classes in the Project level",
"key": "function_roles",
"value": {
"name": "Class Name",
"role": "Description of the neighbourhoood Class role in the project level",
"interactions with selected Class": "How the selected Class interacts with the neighbourhoood Class"
]
}
}
]
}
Ensure the output is strictly in this JSON format without any additional text or explanations.
[output from last round]
[file list]
Based on this file list, continue to supplement and improve the dot graph according to the same requirements, including all [N] files in the dot graph