Skip to content

Commit 2e9f490

Browse files
committed
Merge branch '1.7.x' into oracle-compatibility
2 parents 0cbc70d + 79a5ffd commit 2e9f490

20 files changed

+301
-57
lines changed

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0.
1717

1818
.. towncrier release notes start
1919
20+
[1.7.1] - 2020-02-11
21+
^^^^^^^^^^^^^^^^^^^^
22+
23+
Bugfixes
24+
--------
25+
- `#5106 <https://github.com/rasahq/rasa/issues/5106>`_: Fixed file loading of non proper UTF-8 story files, failing properly when checking for
26+
story files.
27+
- `#5162 <https://github.com/rasahq/rasa/issues/5162>`_: Fix problem with multi-intents.
28+
Training with multi-intents using the ``CountVectorsFeaturizer`` together with ``EmbeddingIntentClassifier`` is
29+
working again.
30+
- `#5171 <https://github.com/rasahq/rasa/issues/5171>`_: Fix bug ``ValueError: Cannot concatenate sparse features as sequence dimension does not match``.
31+
32+
When training a Rasa model that contains responses for just some of the intents, training was failing.
33+
Fixed the featurizers to return a consistent feature vector in case no response was given for a specific message.
34+
- `#5199 <https://github.com/rasahq/rasa/issues/5199>`_: If no text features are present in ``EmbeddingIntentClassifier`` return the intent ``None``.
35+
- `#5216 <https://github.com/rasahq/rasa/issues/5216>`_: Resolve version conflicts: Pin version of cloudpickle to ~=1.2.0.
36+
37+
2038
[1.7.0] - 2020-01-29
2139
^^^^^^^^^^^^^^^^^^^^
2240

changelog/5171.bugfix.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## intent:affirm
2+
- yes
3+
- yep
4+
- yeah
5+
- indeed
6+
- that's right
7+
- ok
8+
- great
9+
- right, thank you
10+
- correct
11+
- great choice
12+
- sounds really good
13+
14+
## intent:goodbye
15+
- bye
16+
- goodbye
17+
- good bye
18+
- stop
19+
- end
20+
- farewell
21+
- Bye bye
22+
- have a good one
23+
24+
## intent:greet
25+
- hey
26+
- howdy
27+
- hey there
28+
- hello
29+
- hi
30+
- good morning
31+
- good evening
32+
- dear sir
33+
34+
## intent:chitchat+ask_name
35+
- What's your name?
36+
- What can I call you?
37+
38+
## intent:chitchat+ask_weather
39+
- How's the weather?
40+
- Is it too hot outside?
41+
42+
## intent:restaurant_search
43+
- i'm looking for a place to eat
44+
- I want to grab lunch
45+
- I am searching for a dinner spot
46+
- i'm looking for a place in the [north](location) of town
47+
- show me [chinese](cuisine) restaurants
48+
- show me [chines](cuisine:chinese) restaurants in the [north](location)
49+
- show me a [mexican](cuisine) place in the [centre](location)
50+
- i am looking for an [indian](cuisine) spot called olaolaolaolaolaola
51+
- search for restaurants
52+
- anywhere in the [west](location)
53+
- anywhere near [18328](location)
54+
- I am looking for [asian fusion](cuisine) food
55+
- I am looking a restaurant in [29432](location)
56+
- I am looking for [mexican indian fusion](cuisine)
57+
- [central](location) [indian](cuisine) restaurant
58+
59+
## synonym:chinese
60+
+ Chines
61+
* Chinese
62+
63+
## synonym:vegetarian
64+
- vegg
65+
- veggie
66+
67+
## regex:zipcode
68+
- [0-9]{5}
69+
70+
## regex:greet
71+
- hey[^\s]*

data/examples/rasa/demo-rasa.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
"common_examples": [
2424
{
2525
"text": "hey",
26-
"intent": "greet",
26+
"intent": "greet",
2727
"entities": []
2828
},
2929
{
3030
"text": "howdy",
31-
"intent": "greet",
31+
"intent": "greet",
3232
"entities": []
3333
},
3434
{
3535
"text": "hey there",
36-
"intent": "greet",
36+
"intent": "greet",
3737
"entities": []
3838
},
3939
{

data/test/many_intents.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
- you are an idiot
33
- You lack understanding.
44

5+
## intent:grett
6+
- Hello
7+
- Hi
8+
- Welcome
9+
510
## intent:thank
611
- Thanks
712
- Thank you

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Understand messages, hold conversations, and connect to messaging channels and A
3131
user-guide/evaluating-models
3232
user-guide/validate-files
3333
user-guide/running-the-server
34-
user-guide/running-rasa-with-docker
34+
user-guide/how-to-deploy
3535
user-guide/cloud-storage
3636

3737
.. toctree::

docs/user-guide/running-rasa-with-docker.rst renamed to docs/user-guide/how-to-deploy.rst

Lines changed: 68 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,64 @@
1-
:desc: Run and ship your Rasa assistant with Docker containers on any
2-
Docker-compatible machine or cluster.
1+
:desc: How to deploy your Rasa Assistant with Docker Compose or Kubernetes/Openshift
32

4-
.. _running-rasa-with-docker:
3+
.. _deploying-your-rasa-assistant:
54

6-
Running Rasa with Docker
7-
========================
5+
Deploying your Rasa Assistant
6+
=============================
87

98
.. edit-link::
109

11-
This is a guide on how to build a Rasa assistant with Docker.
12-
If you haven't used Rasa before, we'd recommend that you start with the :ref:`rasa-tutorial`.
10+
This page explains when and how to deploy an assistant built with Rasa.
11+
It will allow you to make your assistant available to users and set you up with a production-ready environment.
1312

1413
.. contents::
1514
:local:
15+
:depth: 2
16+
17+
18+
When to deploy your assistant
19+
-----------------------------
20+
21+
.. raw:: html
22+
23+
The best time to deploy your assistant and make it available to test users is once it can handle the most important happy paths or is what we call a <a style="text-decoration: none" href="https://rasa.com/docs/rasa/glossary">minimum viable assistant</a>.
24+
25+
The recommended deployment methods described below make it easy to share your assistant with test users via the `share your assistant feature in Rasa X <../../rasa-x/docs/user-guide/enable-workflows#conversations-with-test-users>`_. Then, when you’re ready to make your assistant available via one or more :ref:`messaging-and-voice-channels`, you can easily add them to your existing deployment set up.
26+
27+
.. _recommended-deployment-methods:
28+
29+
Recommended Deployment Methods
30+
------------------------------
31+
32+
The recommended way to deploy an assistant is using either the Docker Compose or Kubernetes/Openshift options we support. Both deploy Rasa X and your assistant. They are the easiest ways to deploy your assistant, allow you to use Rasa X to view conversations and turn them into training data, and are production-ready.
33+
34+
Kubernetes/Openshift
35+
~~~~~~~~~~~~~~~~~~~~
36+
37+
Kubernetes/Openshift is the best option if you need a scalable architecture. It's straightforward to deploy if you use the helm charts we provide. However, you can also customize the Helm charts if you have specific requirements.
38+
39+
- Default: Read the docs `here <../../rasa-x/docs/installation-and-setup/openshift-kubernetes/>`__.
40+
- Custom: Read the docs `here <../../rasa-x/docs/installation-and-setup/openshift-kubernetes/>`__ and customize the `open source Helm charts <https://github.com/RasaHQ/rasa-x-helm>`_.
41+
42+
Docker Compose
43+
~~~~~~~~~~~~~~
44+
45+
- Default: Watching this `video <https://www.youtube.com/watch?v=IUYdwy8HPVc>`__ or read the docs `here <../../rasa-x/docs/installation-and-setup/docker-compose-script/>`__.
46+
- Custom: Read the docs `here <../../rasa-x/docs/installation-and-setup/docker-compose-manual/>`__.
47+
48+
49+
.. _rasa-only-deployment:
50+
51+
Rasa-Only Deployment with Docker Compose
52+
----------------------------------------
53+
54+
It is also possible to deploy a Rasa assistant using Docker Compose without Rasa X.
55+
56+
.. contents::
57+
:local:
58+
1659

1760
Installing Docker
18-
-----------------
61+
~~~~~~~~~~~~~~~~~
1962

2063
If you're not sure if you have Docker installed, you can check by running:
2164

@@ -31,7 +74,7 @@ install Docker.
3174
See `Docker Installation <https://docs.docker.com/install/>`_ for details.
3275

3376
Building an Assistant with Rasa and Docker
34-
------------------------------------------
77+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3578

3679
This section will cover the following:
3780

@@ -44,7 +87,7 @@ This section will cover the following:
4487

4588

4689
Setup
47-
~~~~~
90+
*****
4891

4992
Just like in the :ref:`tutorial <rasa-tutorial>`, you'll use the ``rasa init`` command to create a project.
5093
The only difference is that you'll be running Rasa inside a Docker container, using
@@ -87,7 +130,7 @@ The initial project files should all be there, as well as a ``models`` directory
87130
run the containers with a different user.
88131

89132
Talking to Your Assistant
90-
~~~~~~~~~~~~~~~~~~~~~~~~~
133+
*************************
91134

92135
To talk to your newly-trained assistant, run this command:
93136

@@ -104,10 +147,10 @@ you need to pass the ``-it`` flags.
104147

105148

106149
Customizing your Model
107-
----------------------
150+
~~~~~~~~~~~~~~~~~~~~~~
108151

109152
Choosing a Tag
110-
~~~~~~~~~~~~~~
153+
**************
111154

112155
To keep images as small as possible, we publish different tags of the ``rasa/rasa`` image
113156
with different dependencies installed. See :ref:`choosing-a-pipeline` for more information
@@ -135,7 +178,7 @@ Alternatively, you can use the ``-full`` tag, which includes all pipeline depend
135178
.. _model_training_docker:
136179

137180
Training a Custom Rasa Model with Docker
138-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181+
****************************************
139182

140183
Edit the ``config.yml`` file to use the pipeline you want, and place
141184
your NLU and Core data into the ``data/`` directory.
@@ -173,7 +216,7 @@ You can also leave these out since we are passing the default values.
173216

174217

175218
Running the Rasa Server
176-
-----------------------
219+
~~~~~~~~~~~~~~~~~~~~~~~
177220

178221
To run your AI assistant in production, configure your required
179222
:ref:`messaging-and-voice-channels` in ``credentials.yml``. If this file does not
@@ -203,7 +246,7 @@ Command Description:
203246

204247

205248
Using Docker Compose to Run Multiple Services
206-
---------------------------------------------
249+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207250

208251
To run Rasa together with other services, such as a server for custom actions, it is
209252
recommend to use `Docker Compose <https://docs.docker.com/compose/>`_.
@@ -257,14 +300,14 @@ To run the services configured in your ``docker-compose.yml`` execute:
257300
258301
259302
Adding Custom Actions
260-
---------------------
303+
~~~~~~~~~~~~~~~~~~~~~
261304

262305
To create more sophisticated assistants, you will want to use :ref:`custom-actions`.
263306
Continuing the example from above, you might want to add an action which tells
264307
the user a joke to cheer them up.
265308

266309
Creating a Custom Action
267-
~~~~~~~~~~~~~~~~~~~~~~~~
310+
************************
268311

269312
Start by creating the custom actions in a directory ``actions``:
270313

@@ -301,7 +344,7 @@ Continuing with the example bot from ``rasa init``, replace ``utter_cheer_up`` i
301344
``action_joke`` to the actions in the domain file.
302345

303346
Adding the Action Server
304-
~~~~~~~~~~~~~~~~~~~~~~~~
347+
************************
305348

306349
The custom actions are run by the action server.
307350
To spin it up together with the Rasa instance, add a service
@@ -340,7 +383,7 @@ Run ``docker-compose up`` to start the action server together
340383
with Rasa.
341384

342385
Adding Custom Dependencies
343-
~~~~~~~~~~~~~~~~~~~~~~~~~~
386+
**************************
344387

345388
If your custom action has additional dependencies of systems or Python libraries,
346389
you can add these by extending the official image.
@@ -368,15 +411,15 @@ You can then build the image via the following command, and use it in your
368411
docker build . -t <name of your custom image>:<tag of your custom image>
369412
370413
Adding a Custom Tracker Store
371-
-----------------------------
414+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372415

373416
By default, all conversations are saved in memory. This means that all
374417
conversations are lost as soon as you restart the Rasa server.
375418
If you want to persist your conversations, you can use a different
376419
:ref:`Tracker Store <tracker-stores>`.
377420

378421
Using PostgreSQL as Tracker Store
379-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
422+
*********************************
380423

381424
Start by adding PostgreSQL to your docker-compose file:
382425

@@ -397,7 +440,7 @@ configuration ``config/endpoints.yml``:
397440
db: rasa
398441
399442
Using MongoDB as Tracker Store
400-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
443+
******************************
401444

402445
Start by adding MongoDB to your docker-compose file. The following example
403446
adds the MongoDB as well as a UI (you can skip this), which will be available
@@ -433,7 +476,7 @@ configuration ``endpoints.yml``:
433476
Then start all components with ``docker-compose up``.
434477

435478
Using Redis as Tracker Store
436-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479+
****************************
437480

438481
Start by adding Redis to your docker-compose file:
439482

@@ -452,7 +495,7 @@ configuration ``endpoints.yml``:
452495
url: redis
453496
454497
Using a Custom Tracker Store Implementation
455-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
498+
*******************************************
456499

457500
If you have a custom implementation of a tracker store you have two options
458501
to add this store to Rasa:

rasa/core/tracker_store.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
logger = logging.getLogger(__name__)
3333

34+
SQLITE_SCHEME = "sqlite"
35+
3436

3537
class TrackerStore:
3638
"""Class to hold all of the TrackerStore classes"""
@@ -660,17 +662,20 @@ def get_db_url(
660662
URL ready to be used with an SQLAlchemy `Engine` object.
661663
662664
"""
663-
from urllib.parse import urlsplit
665+
from urllib import parse
664666
from sqlalchemy.engine.url import URL
665667

666668
# Users might specify a url in the host
667-
parsed = urlsplit(host or "")
668-
if parsed.scheme:
669+
parsed = parse.urlsplit(host or "")
670+
# We have to check `scheme` and `hostname` because Python 3.7.6 parses strings
671+
# like `localhost:1234` as a URL with scheme `localhost`. However, `sqlite:///`
672+
# a special case because it doesn't require a hostname.
673+
if parsed.scheme and (parsed.hostname or parsed.scheme == SQLITE_SCHEME):
669674
return host
670675

671676
if host:
672677
# add fake scheme to properly parse components
673-
parsed = urlsplit("schema://" + host)
678+
parsed = parse.urlsplit(f"scheme://{host}")
674679

675680
# users might include the port in the url
676681
port = parsed.port or port

0 commit comments

Comments
 (0)