Skip to content

Commit

Permalink
Merge pull request #131 from PerfectFit-project/388-uncompleted-video…
Browse files Browse the repository at this point in the history
…-dialog

changed celery task in the actions
  • Loading branch information
wbaccinelli authored Jul 21, 2023
2 parents 7e127cd + 42da64f commit 81968a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions Rasa_Bot/actions/actions_preparation_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
DialogExpectedDuration)

from . import validator
from .definitions import MORNING, AFTERNOON, REDIS_URL, TIMEZONE
from .definitions import MORNING, AFTERNOON, REDIS_URL, TIMEZONE, TRIGGER_INTENT
from .helper import get_latest_bot_utterance
from .actions_rescheduling_dialog import get_reschedule_date

Expand Down Expand Up @@ -100,9 +100,8 @@ async def run(self, dispatcher, tracker, domain):
return [FollowupAction('utter_profile_creation_start_3')]

# if the dialog is a video one, launch the watch a video dialog
celery.send_task('celery_tasks.trigger_intervention_component',
(user_id,
ComponentsTriggers.WATCH_VIDEO))
celery.send_task(TRIGGER_INTENT,
(user_id, ComponentsTriggers.WATCH_VIDEO))


class ScheduleNextPrepPhase(Action):
Expand Down
6 changes: 3 additions & 3 deletions Rasa_Bot/actions/actions_watching_a_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from virtual_coach_db.helper.definitions import (VideoLinks, Components, ComponentsTriggers,
DialogExpectedDuration)
from . import validator
from .definitions import PAUSE_AND_TRIGGER, REDIS_URL
from .definitions import PAUSE_AND_TRIGGER, REDIS_URL, TRIGGER_INTENT
from .helper import get_latest_bot_utterance

celery = Celery(broker=REDIS_URL)
Expand All @@ -23,7 +23,7 @@ def name(self):
async def run(self, dispatcher, tracker, domain):
user_id = int(tracker.current_state()['sender_id']) # retrieve userID
new_intent = ComponentsTriggers.WATCH_VIDEO
celery.send_task('celery_tasks.trigger_intervention_component',
celery.send_task(TRIGGER_INTENT,
(user_id, new_intent))
return []

Expand All @@ -38,7 +38,7 @@ async def run(self, dispatcher, tracker, domain):
user_id = int(tracker.current_state()['sender_id']) # retrieve userID
new_intent = ComponentsTriggers.RESCHEDULING_PREPARATION

celery.send_task('celery_tasks.trigger_intervention_component',
celery.send_task(TRIGGER_INTENT,
(user_id, new_intent))
return []

Expand Down

0 comments on commit 81968a8

Please sign in to comment.