Ashar086 commited on
Commit
fd7ad95
·
verified ·
1 Parent(s): 05bf03d

Update components/feedback.py

Browse files
Files changed (1) hide show
  1. components/feedback.py +8 -4
components/feedback.py CHANGED
@@ -1,6 +1,10 @@
1
- from utils.openai_utils import call_openai
2
 
3
  def get_ai_feedback(user_code):
4
- prompt = f"Here is a user's attempt to solve a problem:\n{user_code}\nGive feedback on how they can improve it."
5
- response = call_openai(prompt, max_tokens=200)
6
- return response
 
 
 
 
 
1
+ from utils.aiml_api_utils import call_aiml_api
2
 
3
  def get_ai_feedback(user_code):
4
+ # Create the prompt for AI feedback
5
+ prompt = f"Provide constructive feedback for the following code:\n\n{user_code}"
6
+
7
+ # Call the AI/ML API to generate feedback
8
+ feedback = call_aiml_api(prompt, max_tokens=300)
9
+
10
+ return feedback