diff --git a/app/pipeline/prompts/text_exercise_chat_prompts.py b/app/pipeline/prompts/text_exercise_chat_prompts.py index cf499241..2baf7590 100644 --- a/app/pipeline/prompts/text_exercise_chat_prompts.py +++ b/app/pipeline/prompts/text_exercise_chat_prompts.py @@ -14,7 +14,8 @@ def fmt_guard_prompt( {problem_statement} The user says: {user_input} - If this is on-topic and appropriate discussion, respond with "Yes". If not, respond with "No". + If this is on-topic and appropriate discussion, respond with "Yes". + If the user's input is clearly about something else or inappropriate, respond with "No". """.format( exercise_name=exercise_name, course_name=course_name, diff --git a/app/pipeline/text_exercise_chat_pipeline.py b/app/pipeline/text_exercise_chat_pipeline.py index 3aad4625..9e2f2a59 100644 --- a/app/pipeline/text_exercise_chat_pipeline.py +++ b/app/pipeline/text_exercise_chat_pipeline.py @@ -53,7 +53,7 @@ def guard(self, dto: TextExerciseChatPipelineExecutionDTO) -> bool: course_name=dto.exercise.course.name, course_description=dto.exercise.course.description, problem_statement=dto.exercise.problem_statement, - user_input=dto.current_submission, + user_input=dto.conversation[-1].contents[0].text_content, ) guard_prompt = PyrisMessage( sender=IrisMessageRole.SYSTEM, @@ -91,7 +91,7 @@ def reject(self, dto: TextExerciseChatPipelineExecutionDTO) -> str: course_name=dto.exercise.course.name, course_description=dto.exercise.course.description, problem_statement=dto.exercise.problem_statement, - user_input=dto.current_submission, + user_input=dto.conversation[-1].contents[0].text_content, ) rejection_prompt = PyrisMessage( sender=IrisMessageRole.SYSTEM,