arjunanand13 commited on
Commit
1d394d0
·
verified ·
1 Parent(s): f486bbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -27,12 +27,23 @@ def evaluate_code(exercise, user_code):
27
  """Evaluate the user's code submission."""
28
  prompt = f"""
29
  Exercise: {exercise}
30
-
31
  User's code:
32
  {user_code}
33
-
34
- Briefly evaluate the code. Provide concise feedback on correctness, efficiency, and style.
35
- If there are errors, explain them. Suggest improvements. Keep the response under 150 words.
 
 
 
 
 
 
 
 
 
 
 
36
  """
37
  try:
38
  response = model.generate_content(prompt)
 
27
  """Evaluate the user's code submission."""
28
  prompt = f"""
29
  Exercise: {exercise}
30
+
31
  User's code:
32
  {user_code}
33
+
34
+ Perform a concise code review addressing the following points:
35
+ 1. Correctness: Does the code solve the given problem? If not, what's missing?
36
+ 2. Efficiency: Is the solution efficient? Suggest any optimizations if applicable.
37
+ 3. Style and Best Practices: Comment on code style, readability, and adherence to Python best practices.
38
+ 4. Potential Improvements: Offer 1-2 specific suggestions for improving the code.
39
+
40
+ Format your response as follows:
41
+ Correctness: [Your evaluation]
42
+ Efficiency: [Your evaluation]
43
+ Style: [Your evaluation]
44
+ Improvements: [Your suggestions]
45
+
46
+ Keep the entire response under 200 words and be specific in your feedback.
47
  """
48
  try:
49
  response = model.generate_content(prompt)