Spaces:
Sleeping
Sleeping
Commit
·
71342e9
1
Parent(s):
4e33c9b
update: minor changes
Browse files
logic.py
CHANGED
@@ -46,11 +46,11 @@ class CodeProcessor:
|
|
46 |
prompt_for_generating_similar_code = [
|
47 |
{
|
48 |
"role": "system",
|
49 |
-
"content": "You are a code generation assistant. Your task is to analyze the provided code snippet and identify the problem it addresses. Create a prompt that generates similar code with the same functionality. Try to understand what is the application we are building. Focus on understanding the core features, the logic behind the implementation, and any required libraries. Ensure that the prompt captures the essence of what the code is solving without requiring the user to specify the problem."
|
50 |
},
|
51 |
{
|
52 |
"role": "user",
|
53 |
-
"content": f"Here is the code I want to replicate: {code_text}. Please generate a prompt that can produce similar code, focusing on understanding the problem being solved, core features, required packages, and the overall logic behind the implementation without giving a single line of code
|
54 |
}
|
55 |
]
|
56 |
|
@@ -65,22 +65,13 @@ class CodeProcessor:
|
|
65 |
print("Prompt generation completed............")
|
66 |
|
67 |
markdown_output = f"""
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
# Similar Code Generation Prompt for Code Snippets
|
81 |
-
|
82 |
-
{prompt_for_generating_similar_code_response}
|
83 |
-
|
84 |
-
|
85 |
-
"""
|
86 |
return markdown_output
|
|
|
46 |
prompt_for_generating_similar_code = [
|
47 |
{
|
48 |
"role": "system",
|
49 |
+
"content": "You are a code generation assistant. Your task is to analyze the provided code snippet and identify the problem it addresses. Create a prompt that generates similar code with the same functionality step by step. Try to understand what is the application we are building. Focus on understanding the core features, the logic behind the implementation, and any required libraries. Ensure that the prompt captures the essence of what the code is solving without requiring the user to specify the problem."
|
50 |
},
|
51 |
{
|
52 |
"role": "user",
|
53 |
+
"content": f"Here is the code I want to replicate: {code_text}. Please generate a prompt that can produce similar code, focusing on understanding the problem being solved, core features, required packages, and the overall logic behind the implementation without giving a single line of code,"
|
54 |
}
|
55 |
]
|
56 |
|
|
|
65 |
print("Prompt generation completed............")
|
66 |
|
67 |
markdown_output = f"""
|
68 |
+
# Summary of Code Snippet
|
69 |
+
{summary_response}
|
70 |
+
|
71 |
+
# Detailed Code Explanation for Snippet
|
72 |
+
{detail_generation_response}
|
73 |
+
|
74 |
+
# Similar Code Generation Prompt for Code Snippets
|
75 |
+
{prompt_for_generating_similar_code_response}
|
76 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
return markdown_output
|