Skip to content

Commit 2c03054

Browse files
committed
Merge branch '1.4.x' into prepare-1.5.0
2 parents 287e082 + b476c27 commit 2c03054

File tree

5 files changed

+72
-16
lines changed

5 files changed

+72
-16
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Added
2222
stored under the ``metadata`` key when reading the event from a JSON object or
2323
dictionary.
2424
- Add command line argument ``rasa x --config CONFIG``, to specify path to the policy
25-
and NLU pipeline configuration of your bot (default: ``config.yml``)
25+
and NLU pipeline configuration of your bot (default: ``config.yml``).
2626
- Added a new NLU featurizer - ``ConveRTFeaturizer`` based on `ConveRT
2727
<https://github.com/PolyAI-LDN/polyai-models>`_ model released by PolyAI.
2828
- Added a new preconfigured pipeline - ``pretrained_embeddings_convert``.
@@ -46,6 +46,14 @@ Fixed
4646
- Fixed bug where facebooks generic template was not rendered when buttons were ``None``
4747
- Fixed default intents unnecessarily raising undefined parsing error
4848

49+
[1.4.6] - 2019-11-22
50+
^^^^^^^^^^^^^^^^^^^^
51+
52+
Fixed
53+
-----
54+
- Fixed Rasa X not working when any tracker store was configured for Rasa.
55+
- Use the matplotlib backend ``agg`` in case the ``tkinter`` package is not installed.
56+
4957
[1.4.5] - 2019-11-14
5058
^^^^^^^^^^^^^^^^^^^^
5159

docs/user-guide/installation.rst

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Installation
1313
Quick Installation
1414
~~~~~~~~~~~~~~~~~~
1515

16-
You can install both Rasa and Rasa X using pip (requires Python 3.6.0 or higher).
16+
You can install both Rasa Open Source and Rasa X using pip (requires Python 3.6 or 3.7).
1717

1818
.. code-block:: bash
1919
@@ -141,17 +141,29 @@ Tools like `virtualenv <https://virtualenv.pypa.io/en/latest/>`_ and `virtualenv
141141

142142
.. tabs::
143143

144-
.. tab:: Rasa and Rasa X
144+
.. tab:: Rasa Open Source and Rasa X
145145

146-
To install both Rasa and Rasa X in one go:
146+
First make sure your ``pip`` version is up to date:
147+
148+
.. code-block:: bash
149+
150+
$ pip install -U pip
151+
152+
To install both Rasa Open Source and Rasa X in one go:
147153

148154
.. code-block:: bash
149155
150156
$ pip install rasa-x --extra-index-url https://pypi.rasa.com/simple
151157
152-
.. tab:: Rasa only
158+
.. tab:: Rasa Open Source only
159+
160+
First make sure your ``pip`` version is up to date:
161+
162+
.. code-block:: bash
163+
164+
$ pip install -U pip
153165
154-
If you just want to install Rasa without Rasa X:
166+
To install Rasa Open Source without Rasa X:
155167

156168
.. code-block:: bash
157169
@@ -175,7 +187,7 @@ You can now head over to the tutorial.
175187
Building from Source
176188
~~~~~~~~~~~~~~~~~~~~
177189

178-
If you want to use the development version of Rasa, you can get it from GitHub:
190+
If you want to use the development version of Rasa Open Source, you can get it from GitHub:
179191

180192
.. code-block:: bash
181193
@@ -205,7 +217,7 @@ for your assistant.
205217
I have decided on a pipeline. How do I install the dependencies for it?
206218
-----------------------------------------------------------------------
207219

208-
When you install Rasa, the dependencies for the ``supervised_embeddings`` - TensorFlow
220+
When you install Rasa Open Source, the dependencies for the ``supervised_embeddings`` - TensorFlow
209221
and sklearn_crfsuite get automatically installed. However, spaCy and MITIE need to be separately installed if you want to use pipelines containing components from those libraries.
210222

211223
.. admonition:: Just give me everything!
@@ -235,9 +247,9 @@ You can install it with the following commands:
235247
$ python -m spacy download en_core_web_md
236248
$ python -m spacy link en_core_web_md en
237249
238-
This will install Rasa NLU as well as spacy and its language model
250+
This will install Rasa Open Source as well as spaCy and its language model
239251
for the English language. We recommend using at least the
240-
"medium" sized models (``_md``) instead of the spacy's
252+
"medium" sized models (``_md``) instead of the spaCy's
241253
default small ``en_core_web_sm`` model. Small models require less
242254
memory to run, but will somewhat reduce intent classification performance.
243255

rasa/cli/x.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def _overwrite_endpoints_for_local_x(
118118
wait_time_between_pulls=2,
119119
)
120120

121-
overwrite_existing_event_broker = False
122121
if endpoints.event_broker and not _is_correct_event_broker(endpoints.event_broker):
123122
cli_utils.print_error(
124123
"Rasa X currently only supports a SQLite event broker with path '{}' "
@@ -133,8 +132,9 @@ def _overwrite_endpoints_for_local_x(
133132
if not overwrite_existing_event_broker:
134133
exit(0)
135134

136-
if not endpoints.tracker_store or overwrite_existing_event_broker:
137-
endpoints.event_broker = EndpointConfig(type="sql", db=DEFAULT_EVENTS_DB)
135+
endpoints.event_broker = EndpointConfig(
136+
type="sql", db=DEFAULT_EVENTS_DB, dialect="sqlite"
137+
)
138138

139139

140140
def _is_correct_event_broker(event_broker: EndpointConfig) -> bool:

rasa/core/test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
from rasa.nlu.training_data.formats.markdown import MarkdownWriter
1313
from rasa.core.trackers import DialogueStateTracker
1414
from rasa.utils.io import DEFAULT_ENCODING
15+
import matplotlib
1516

1617
if typing.TYPE_CHECKING:
1718
from rasa.core.agent import Agent
1819

19-
import matplotlib
20+
try:
21+
# If the `tkinter` package is available, we can use the `TkAgg` backend
22+
import tkinter
2023

21-
matplotlib.use("TkAgg")
24+
matplotlib.use("TkAgg")
25+
except ImportError:
26+
matplotlib.use("agg")
2227

2328
logger = logging.getLogger(__name__)
2429

tests/cli/test_rasa_x.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
from pathlib import Path
2+
from unittest.mock import Mock
23

4+
from typing import Callable, Dict, Text, Any
35
import pytest
4-
from typing import Callable, Dict
56
from _pytest.pytester import RunResult
7+
from _pytest.monkeypatch import MonkeyPatch
8+
import questionary
69

710
from aioresponses import aioresponses
811

912
import rasa.utils.io as io_utils
1013
from rasa.cli import x
14+
from rasa.core.utils import AvailableEndpoints
1115
from rasa.utils.endpoints import EndpointConfig
1216

1317

@@ -61,6 +65,33 @@ def test_prepare_credentials_if_already_valid(tmpdir: Path):
6165
assert actual == credentials
6266

6367

68+
@pytest.mark.parametrize(
69+
"event_broker",
70+
[
71+
# Event broker was not configured.
72+
{},
73+
# Event broker was explicitly configured to work with Rasa X in local mode.
74+
{"type": "sql", "dialect": "sqlite", "db": x.DEFAULT_EVENTS_DB},
75+
# Event broker was configured but the values are not compatible for running Rasa
76+
# X in local mode.
77+
{"type": "sql", "dialect": "postgresql"},
78+
],
79+
)
80+
def test_overwrite_endpoints_for_local_x(
81+
event_broker: Dict[Text, Any], monkeypatch: MonkeyPatch
82+
):
83+
confirm = Mock()
84+
confirm.return_value.ask.return_value = True
85+
monkeypatch.setattr(questionary, "confirm", confirm)
86+
87+
event_broker_config = EndpointConfig.from_dict(event_broker)
88+
endpoints = AvailableEndpoints(event_broker=event_broker_config)
89+
90+
x._overwrite_endpoints_for_local_x(endpoints, "test-token", "http://localhost:5002")
91+
92+
assert x._is_correct_event_broker(endpoints.event_broker)
93+
94+
6495
def test_if_endpoint_config_is_valid_in_local_mode():
6596
config = EndpointConfig(type="sql", dialect="sqlite", db=x.DEFAULT_EVENTS_DB)
6697

0 commit comments

Comments
 (0)