From 0903dcb3de59cbdaa6801f8b2b7250159dea5ea3 Mon Sep 17 00:00:00 2001 From: ashish-spext Date: Wed, 30 Oct 2024 20:09:51 +0530 Subject: [PATCH 1/2] ProfanityRemoverAgent: Improve prompt and fix status bug --- backend/director/agents/profanity_remover.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/director/agents/profanity_remover.py b/backend/director/agents/profanity_remover.py index aa5bf22..a6c6d30 100644 --- a/backend/director/agents/profanity_remover.py +++ b/backend/director/agents/profanity_remover.py @@ -67,10 +67,15 @@ def run( """ try: beep_audio_id = beep_audio_id or BEEP_AUDIO_ID + error_message = ( + "Please provide the beep_audio_id, or set up BEEP_AUDIO_ID in the .env file located in the backend directory." + "Notify user this verbatum in summary as well since it isn't displayed to them: If you don’t have a beep sound ready, you can use the audio from https://www.youtube.com/watch?v=GvXbEO5Kbgc YouTube link. Upload it as audio, obtain the audio ID, and set it as BEEP_AUDIO_ID in your .env file.'" + "Remember to add above line in summary." + ) if not beep_audio_id: return AgentResponse( - status=AgentStatus.failed, - message="Please provide the beep_audio_id or setup BEEP_AUDIO_ID in .env of backend directory.", + status=AgentStatus.ERROR, + message=error_message, ) self.output_message.actions.append("Started process to remove profanity..") video_content = VideoContent( From 66369907bc7363c345e9e40dd8aa751396b220b6 Mon Sep 17 00:00:00 2001 From: ashish-spext Date: Wed, 30 Oct 2024 20:18:57 +0530 Subject: [PATCH 2/2] ProfanityRemoerAgent: Move error message inside where it is being used. --- backend/director/agents/profanity_remover.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/director/agents/profanity_remover.py b/backend/director/agents/profanity_remover.py index a6c6d30..c4f2464 100644 --- a/backend/director/agents/profanity_remover.py +++ b/backend/director/agents/profanity_remover.py @@ -67,12 +67,12 @@ def run( """ try: beep_audio_id = beep_audio_id or BEEP_AUDIO_ID - error_message = ( - "Please provide the beep_audio_id, or set up BEEP_AUDIO_ID in the .env file located in the backend directory." - "Notify user this verbatum in summary as well since it isn't displayed to them: If you don’t have a beep sound ready, you can use the audio from https://www.youtube.com/watch?v=GvXbEO5Kbgc YouTube link. Upload it as audio, obtain the audio ID, and set it as BEEP_AUDIO_ID in your .env file.'" - "Remember to add above line in summary." - ) if not beep_audio_id: + error_message = ( + "Please provide the beep_audio_id, or set up BEEP_AUDIO_ID in the .env file located in the backend directory." + "Notify user this verbatum in summary as well since it isn't displayed to them: If you don’t have a beep sound ready, you can use the audio from https://www.youtube.com/watch?v=GvXbEO5Kbgc YouTube link. Upload it as audio, obtain the audio ID, and set it as BEEP_AUDIO_ID in your .env file.'" + "Remember to add above line in summary." + ) return AgentResponse( status=AgentStatus.ERROR, message=error_message,