Skip to content

Commit

Permalink
port to core 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
akelad committed Sep 6, 2018
1 parent c99a77f commit 94462be
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -37,4 +37,4 @@ RUN pip install -e .

EXPOSE 5001

CMD ["python", "demo/main.py"]
CMD ["make", "run-actions"]
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -12,14 +12,18 @@ help:
@echo " visualize"
@echo " Saves the story graphs into a file"

run-actions:
python3 -m rasa_core_sdk.endpoint --actions demo.actions

train-nlu:
python3 -m rasa_nlu.train -c nlu_tensorflow.yml --fixed_model_name current --data data/nlu/ -o models --project nlu --verbose

train-core:
python3 demo/train_core.py

run-cmdline:
python3 -m rasa_core.run -d models/dialogue -u models/nlu/current --debug
make run-actions&
python3 -m rasa_core.run -d models/dialogue -u models/nlu/current --debug --endpoints endpoints.yml

visualize:
python3 -m rasa_core.visualize -s data/core/ -d domain.yml -o story_graph.png
15 changes: 8 additions & 7 deletions demo/actions.py
Expand Up @@ -2,8 +2,9 @@

import logging

from rasa_core.actions.action import Action
from rasa_core.events import SlotSet, UserUtteranceReverted, ConversationPaused
from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet, UserUtteranceReverted, \
ConversationPaused

from demo.api import MailChimpAPI
from demo import config
Expand Down Expand Up @@ -79,7 +80,7 @@ def run(self, dispatcher, tracker, domain):
# In future this should be stored in a `budget_unconfirmed` slot where
# the user will then be asked to confirm this is there budget
if not budget:
budget = tracker.latest_message.text
budget = tracker.latest_message.get('text')

return [SlotSet('budget', budget)]

Expand All @@ -94,7 +95,7 @@ def run(self, dispatcher, tracker, domain):

# we grab the whole user utterance here as there are no real entities
# in the use case
use_case = tracker.latest_message.text
use_case = tracker.latest_message.get('text')

return [SlotSet('use_case', use_case)]

Expand Down Expand Up @@ -131,7 +132,7 @@ def run(self, dispatcher, tracker, domain):
# in future this will be stored in a `name_unconfirmed` slot and the
# user will be asked to confirm their name
if not person_name:
person_name = tracker.latest_message.text
person_name = tracker.latest_message.get('text')

return [SlotSet('person_name', person_name)]

Expand All @@ -149,7 +150,7 @@ def run(self, dispatcher, tracker, domain):
# in future this will be stored in a `company_unconfirmed` slot and
# the user will be asked to confirm their company name
if not company:
company = tracker.latest_message.text
company = tracker.latest_message.get('text')

return [SlotSet('company_name', company)]

Expand All @@ -168,7 +169,7 @@ def run(self, dispatcher, tracker, domain):
# in future this will be stored in a `job_unconfirmed` slot and
# the user will be asked to confirm their job title
if not jobfunction:
jobfunction = tracker.latest_message.text
jobfunction = tracker.latest_message.get('text')

return [SlotSet('job_function', jobfunction)]

Expand Down
20 changes: 10 additions & 10 deletions domain.yml
Expand Up @@ -189,13 +189,13 @@ actions:
- utter_nohelp
- utter_thumbsup
- utter_cantsignup
- demo.actions.ActionSubscribeNewsletter
- demo.actions.ActionStoreSalesInfo
- demo.actions.ActionStoreBudget
- demo.actions.ActionStoreUsecase
- demo.actions.ActionChitchat
- demo.actions.ActionStoreName
- demo.actions.ActionStoreCompany
- demo.actions.ActionStoreJob
- demo.actions.ActionStoreEmail
- demo.actions.ActionPause
- action_subscribe_newsletter
- action_store_sales_info
- action_store_budget
- action_store_usecase
- action_chitchat
- action_store_name
- action_store_company
- action_store_job
- action_store_email
- action_pause
2 changes: 2 additions & 0 deletions endpoints.yml
@@ -0,0 +1,2 @@
action_endpoint:
url: http://localhost:5055/webhook
4 changes: 2 additions & 2 deletions requirements.txt
@@ -1,5 +1,5 @@
rasa_nlu[tensorflow]==0.13.1
rasa_core==0.10.4
rasa_nlu[tensorflow]==0.13.2
rasa_core==0.11.3
mailchimp3==3.0.2
oauth2client==4.1.2
gspread==3.0.0
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Expand Up @@ -3,8 +3,8 @@
import os

install_requires = [
'rasa_nlu[tensorflow]~=0.13.1',
'rasa_core~=0.10.4',
'rasa_nlu[tensorflow]~=0.13.2',
'rasa_core~=0.11.3',
'mailchimp3~=3.0.2',
'oauth2client~=4.1.2',
'gspread~=3.0.0'
Expand All @@ -27,7 +27,7 @@
"Programming Language :: Python :: 3.6"
],
packages=find_packages(),
version='1.0',
version='1.1',
install_requires=install_requires,
description="Rasa Demo Bot",
long_description=long_description,
Expand Down

0 comments on commit 94462be

Please sign in to comment.