arun-j0 commited on
Commit
9f5fa52
·
1 Parent(s): 941cc3e

chore: system promt refactor

Browse files
Files changed (1) hide show
  1. groq_client.py +13 -14
groq_client.py CHANGED
@@ -58,20 +58,19 @@ def send_to_groq_api_with_context(markdown, code, output, cell_index):
58
  Sends markdown, code, and output to the Groq API for grading.
59
  """
60
  prompt = f"""
61
- You are a Python notebook grader. Below is a question or context from a Jupyter notebook, followed by the corresponding Python code and its output.
62
-
63
- Please provide:
64
- 1. A grade out of 10 for this cell.
65
- 2. Detailed remarks on the quality of the code, including its readability, efficiency, and accuracy.
66
- 3. Suggestions for improving the code if necessary.
67
- 4. Comments on how well the code addresses the context or question provided.
68
- 5. Actionable suggestions for improvement, including alternative solutions and learning resources.
69
- 6. Code Quality: Assess readability, modularity, and adherence to Pythonic practices.
70
- 7. Efficiency: Evaluate computational efficiency and suggest optimizations if necessary.
71
- 8. Outputs: Verify the correctness and clarity of the outputs.
72
- 9. Areas for improvement: Mention specific areas where the code or logic can be improved.
73
- 10. Logical Errors: Specifically check if the code has logical errors or flaws that would prevent it from achieving the intended result, even if it runs without errors.
74
-
75
  Cell Index: {cell_index}
76
 
77
  Context or Question:
 
58
  Sends markdown, code, and output to the Groq API for grading.
59
  """
60
  prompt = f"""
61
+ You are a Python notebook grader. Below is the context or question from a Jupyter notebook, followed by the corresponding Python code and its output.
62
+
63
+ Your task is to:
64
+ 1. Grade the cell on a scale of 1 to 10 based on correctness, readability, and efficiency.
65
+ 2. Assess how well the code addresses the provided context or question.
66
+ 3. Identify any logical errors or flaws that would prevent the code from achieving its intended result, even if it runs without errors.
67
+ 4. Provide actionable suggestions for improvement, focusing on:
68
+ - Code readability, modularity, and adherence to Pythonic practices.
69
+ - Computational efficiency and possible optimizations.
70
+ - Improvements in the clarity of the output and whether it aligns with the context.
71
+ 5. Identify areas for improvement and suggest alternative solutions if applicable.
72
+ 6. Avoid generating additional code unless it helps in demonstrating a recommended improvement.
73
+
 
74
  Cell Index: {cell_index}
75
 
76
  Context or Question: