Spaces:
Sleeping
Sleeping
update: evaluation
Browse files
EVALUATION_CAROUSEL_UPDATES.md
ADDED
|
File without changes
|
HYDRATION_ERROR_FIXES.md
ADDED
|
File without changes
|
src/agents/evaluation/agent.py
CHANGED
|
@@ -22,6 +22,9 @@ class ResponseFormatter(BaseModel):
|
|
| 22 |
..., description="List of specific improvement suggestions"
|
| 23 |
)
|
| 24 |
next_steps: List[str] = Field(..., description="List of recommended next steps")
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
# Create the prompt template
|
|
@@ -158,6 +161,9 @@ Remember: Your goal is to help learners feel motivated while giving them clear p
|
|
| 158 |
"improvements": structured_output.improvements,
|
| 159 |
"suggestions": structured_output.suggestions,
|
| 160 |
"next_steps": structured_output.next_steps,
|
|
|
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
|
| 163 |
return result
|
|
|
|
| 22 |
..., description="List of specific improvement suggestions"
|
| 23 |
)
|
| 24 |
next_steps: List[str] = Field(..., description="List of recommended next steps")
|
| 25 |
+
words_used: List[str] = Field(..., description="List of key words used from the scenario")
|
| 26 |
+
perfect_response: str = Field(..., description="An example of a perfect response for this scenario")
|
| 27 |
+
impressive_words: List[str] = Field(..., description="List of impressive or advanced words used by the learner")
|
| 28 |
|
| 29 |
|
| 30 |
# Create the prompt template
|
|
|
|
| 161 |
"improvements": structured_output.improvements,
|
| 162 |
"suggestions": structured_output.suggestions,
|
| 163 |
"next_steps": structured_output.next_steps,
|
| 164 |
+
"words_used": structured_output.words_used,
|
| 165 |
+
"perfect_response": structured_output.perfect_response,
|
| 166 |
+
"impressive_words": structured_output.impressive_words,
|
| 167 |
}
|
| 168 |
|
| 169 |
return result
|
src/agents/evaluation/prompt.py
CHANGED
|
@@ -56,6 +56,15 @@ Provide concrete, actionable suggestions for improvement with examples.
|
|
| 56 |
### NEXT STEPS:
|
| 57 |
Recommend specific next steps for continued learning and practice.
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
## Important Guidelines:
|
| 60 |
- **Be encouraging**: Focus on growth, not just mistakes
|
| 61 |
- **Be specific**: Give concrete examples, not vague advice
|
|
|
|
| 56 |
### NEXT STEPS:
|
| 57 |
Recommend specific next steps for continued learning and practice.
|
| 58 |
|
| 59 |
+
### WORDS USED:
|
| 60 |
+
List the key vocabulary words from the scenario that the learner successfully used.
|
| 61 |
+
|
| 62 |
+
### PERFECT RESPONSE:
|
| 63 |
+
Provide an example of a perfect response that demonstrates optimal use of vocabulary, grammar, and engagement for this scenario.
|
| 64 |
+
|
| 65 |
+
### IMPRESSIVE WORDS:
|
| 66 |
+
List any advanced or particularly well-used vocabulary words that the learner incorporated.
|
| 67 |
+
|
| 68 |
## Important Guidelines:
|
| 69 |
- **Be encouraging**: Focus on growth, not just mistakes
|
| 70 |
- **Be specific**: Give concrete examples, not vague advice
|
src/apis/routes/evaluation_route.py
CHANGED
|
@@ -22,13 +22,17 @@ class EvaluationResponse(BaseModel):
|
|
| 22 |
improvements: list
|
| 23 |
suggestions: list
|
| 24 |
next_steps: list
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
@router.post("/conversation", response_model=EvaluationResponse, status_code=status.HTTP_200_OK)
|
| 28 |
async def evaluate_conversation_endpoint(request: EvaluationRequest):
|
| 29 |
"""Evaluate a conversation and provide feedback"""
|
| 30 |
-
logger.info(
|
| 31 |
-
|
|
|
|
| 32 |
try:
|
| 33 |
result = await evaluate_conversation(
|
| 34 |
session_id=request.session_id,
|
|
@@ -37,12 +41,12 @@ async def evaluate_conversation_endpoint(request: EvaluationRequest):
|
|
| 37 |
scenario_description=request.scenario_description or "",
|
| 38 |
key_vocabulary=request.key_vocabulary or ""
|
| 39 |
)
|
| 40 |
-
|
| 41 |
-
return
|
| 42 |
-
|
| 43 |
except Exception as e:
|
| 44 |
logger.error(f"Error in conversation evaluation: {str(e)}")
|
| 45 |
raise HTTPException(
|
| 46 |
-
status_code=500,
|
| 47 |
detail=f"Failed to evaluate conversation: {str(e)}"
|
| 48 |
-
)
|
|
|
|
| 22 |
improvements: list
|
| 23 |
suggestions: list
|
| 24 |
next_steps: list
|
| 25 |
+
words_used: list
|
| 26 |
+
perfect_response: str
|
| 27 |
+
impressive_words: list
|
| 28 |
|
| 29 |
|
| 30 |
@router.post("/conversation", response_model=EvaluationResponse, status_code=status.HTTP_200_OK)
|
| 31 |
async def evaluate_conversation_endpoint(request: EvaluationRequest):
|
| 32 |
"""Evaluate a conversation and provide feedback"""
|
| 33 |
+
logger.info(
|
| 34 |
+
f"Received evaluation request for session: {request.session_id}")
|
| 35 |
+
|
| 36 |
try:
|
| 37 |
result = await evaluate_conversation(
|
| 38 |
session_id=request.session_id,
|
|
|
|
| 41 |
scenario_description=request.scenario_description or "",
|
| 42 |
key_vocabulary=request.key_vocabulary or ""
|
| 43 |
)
|
| 44 |
+
|
| 45 |
+
return result
|
| 46 |
+
|
| 47 |
except Exception as e:
|
| 48 |
logger.error(f"Error in conversation evaluation: {str(e)}")
|
| 49 |
raise HTTPException(
|
| 50 |
+
status_code=500,
|
| 51 |
detail=f"Failed to evaluate conversation: {str(e)}"
|
| 52 |
+
)
|