Skip to content

Commit

Permalink
Merge branch '2.0.x' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Oct 7, 2020
2 parents 2afe0a9 + 3326211 commit fe33091
Show file tree
Hide file tree
Showing 76 changed files with 1,681 additions and 477 deletions.
3 changes: 3 additions & 0 deletions .typo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ excluded_words:
- mongod
- mrkdown
- mrkdwn
- myio
- mymodelname
- myuser
- numpy
Expand Down Expand Up @@ -149,6 +150,7 @@ excluded_words:
- sanitization
- scipy
- sklearn
- socketio
- spacy
- spacyfeaturizer
- spacynlp
Expand Down Expand Up @@ -178,6 +180,7 @@ excluded_words:
- crypto
- regexes
- walkthroughs
- webexteams
- venv
- regexfeaturizer
- crfentityextractor
Expand Down
1 change: 1 addition & 0 deletions changelog/6603.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug in rasa interactive. Now it exports the stories and nlu training data as yml file.
3 changes: 3 additions & 0 deletions changelog/6803.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed the bug that caused `supported_language_list` of `Component` to not work correctly.

To avoid confusion, only one of `supported_language_list` and `not_supported_language_list` can be set to not `None` now
2 changes: 2 additions & 0 deletions changelog/6929.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Check if a model was provided when executing `rasa test core`.
If not, print a useful error message and stop.
12 changes: 12 additions & 0 deletions changelog/6934.removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Conversation sessions](domain.mdx#session-configuration) are now enabled by default
if your [Domain](domain.mdx) does not contain a session configuration.
Previously a missing session configuration was treated as if conversation sessions
were disabled. You can explicitly disable conversation sessions using the following
snippet:

```yaml-rasa title="domain.yml"
session_config:
# A session expiration time of `0`
# disables conversation sessions
session_expiration_time: 0
```
19 changes: 19 additions & 0 deletions data/test_config/config_defaults.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
language: en
pipeline: []
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
# - name: WhitespaceTokenizer
# - name: RegexFeaturizer
# - name: LexicalSyntacticFeaturizer
# - name: CountVectorsFeaturizer
# - name: CountVectorsFeaturizer
# analyzer: char_wb
# min_ngram: 1
# max_ngram: 4
# - name: DIETClassifier
# epochs: 100
# - name: EntitySynonymMapper
# - name: ResponseSelector
# epochs: 100
# - name: FallbackClassifier
# threshold: 0.3
# ambiguity_threshold: 0.1

data:
6 changes: 6 additions & 0 deletions data/test_config/config_response_selector_minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: en
pipeline:
- name: WhitespaceTokenizer
- name: CountVectorsFeaturizer
- name: ResponseSelector
epochs: 1
10 changes: 10 additions & 0 deletions data/test_nlu_no_responses/domain_with_only_responses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
responses:
utter_chitchat/ask_name:
- image: "https://i.imgur.com/zTvA58i.jpeg"
text: hello, my name is retrieval bot.
- text: Oh yeah, I am called the retrieval bot.

utter_chitchat/ask_weather:
- text: Oh, it does look sunny right now in Berlin.
image: "https://i.imgur.com/vwv7aHN.png"
- text: I am not sure of the whole week but I can see the sun is out today.
16 changes: 16 additions & 0 deletions data/test_nlu_no_responses/nlu_no_responses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "2.0"

nlu:
- intent: chitchat/ask_name
examples: |
- What is your name?
- May I know your name?
- What do people call you?
- Do you have a name for yourself?
- intent: chitchat/ask_weather
examples: |
- What's the weather like today?
- Does it look sunny outside today?
- Oh, do you mind checking the weather for me please?
- I like sunny days in Berlin.
179 changes: 179 additions & 0 deletions data/test_trackers/tracker_moodbot_with_new_utterances.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"latest_message": {
"entities": [],
"intent": {
"confidence": 0.60,
"name": "mood_great"
},
"message_id": null,
"metadata": {},
"text": "/mood_great",
"intent_ranking": [
{
"confidence": 0.60,
"name": "mood_great"
},
{
"confidence": 0.20,
"name": "greet"
},
{
"confidence": 0.20,
"name": "goodbye"
}
]
},
"sender_id": "mysender",
"latest_action": {"action_name": "action_listen"},
"latest_action_name": "action_listen",
"active_loop": {},
"paused": false,
"latest_event_time": 1517821726.211042,
"followup_action": null,
"slots": {"name": null},
"latest_input_channel": null,
"events": [
{
"timestamp": 1517821726.211031,
"event": "action",
"name": "action_listen",
"policy": null,
"confidence": null
},
{
"timestamp": 1517821726.200036,
"metadata": {},
"parse_data": {
"entities": [],
"intent": {
"confidence": 0.54,
"name": "greet"
},
"message_id": null,
"metadata": {},
"text": "/greet",
"intent_ranking": [
{
"confidence": 0.54,
"name": "greet"
},
{
"confidence": 0.31,
"name": "goodbye"
},
{
"confidence": 0.15,
"name": "default"
}
]
},
"event": "user",
"text": "/greet",
"input_channel": null, "message_id": null, "metadata": {}
},
{
"timestamp": 1517821726.200373,
"event": "action",
"name": "utter_greet",
"policy": null,
"confidence": null
},
{
"timestamp": 1517821726.211038,
"event": "action",
"name": "action_listen",
"policy": null,
"confidence": null
},
{
"timestamp": 1517821726.209836,
"metadata": {},
"parse_data": {
"entities": [],
"intent": {
"confidence": 0.60,
"name": "mood_great"
},
"message_id": null,
"metadata": {},
"text": "/mood_great",
"intent_ranking": [
{
"confidence": 0.60,
"name": "mood_great"
},
{
"confidence": 0.20,
"name": "greet"
},
{
"confidence": 0.20,
"name": "goodbye"
}
]
},
"event": "user",
"text": "/mood_great",
"input_channel": null, "message_id": null, "metadata": {}
},
{
"timestamp": 1517821726.209908,
"event": "action",
"name": "utter_happy",
"policy": "policy_1_TEDPolicy",
"confidence": 0.8
},
{
"timestamp": 1517821726.211042,
"event": "action",
"name": "action_listen",
"policy": "policy_2_MemoizationPolicy",
"confidence": 1.0
},
{
"timestamp": 1517821730.209836,
"metadata": {},
"parse_data": {
"entities": [],
"intent": {
"confidence": 0.60,
"name": "mood_great"
},
"message_id": null,
"metadata": {},
"text": "my mood is so great!",
"intent_ranking": [
{
"confidence": 0.60,
"name": "mood_great"
},
{
"confidence": 0.20,
"name": "greet"
},
{
"confidence": 0.20,
"name": "goodbye"
}
]
},
"event": "user",
"text": "/mood_great",
"input_channel": null, "message_id": null, "metadata": {}
},
{
"timestamp": 1517821740.209908,
"event": "action",
"name": "utter_happy",
"policy": "policy_1_TEDPolicy",
"confidence": 0.8
},
{
"timestamp": 1517821750.211042,
"event": "action",
"name": "action_listen",
"policy": "policy_2_MemoizationPolicy",
"confidence": 1.0
}
]
}
7 changes: 0 additions & 7 deletions docs/docs/cheatsheet.mdx

This file was deleted.

23 changes: 10 additions & 13 deletions docs/docs/connectors/cisco-webex-teams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,28 @@ be used in `room` variable in the `credentials.yml` file.
Please follow this link below to find the room ID
`https://developer.webex.com/endpoint-rooms-get.html`

## Running on Cisco Webex
In the OAuth & Permissions section, add the URL of the Rasa Open Source endpoint
that Webex should forward the messages to. The endpoint for receiving Cisco Webex Teams messages
is `http://<host>:<port>/webhooks/webexteams/webhook`, replacing
the host and port with the appropriate values from your running Rasa X or Rasa Open Source server.

If you want to connect to the `webexteams` input channel using the run
script, e.g. using:
## Running on Cisco Webex Teams

```bash
rasa run
```

you need to supply a `credentials.yml` with the following content:
Add the Webex Teams credentials to your `credentials.yml`:

```yaml-rasa
webexteams:
access_token: "YOUR-BOT-ACCESS-TOKEN"
room: "YOUR-CISCOWEBEXTEAMS-ROOM-ID"
```

The endpoint for receiving Cisco Webex Teams messages is
`http://localhost:5005/webhooks/webexteams/webhook`, replacing
the host and port with the appropriate values. This is the URL
you should add in the OAuth & Permissions section.

Restart your Rasa X or Rasa Open Source server
to make the new channel endpoint available for Cisco Webex Teams to send messages to.

:::note
If you do not set the `room` keyword
argument, messages will by delivered back to
the user who sent them.

:::
:::
29 changes: 14 additions & 15 deletions docs/docs/connectors/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ messaging service can call to deliver messages.
Your blueprint should have at least the two routes: `health` on `/`,
and `receive` on the HTTP route `/webhook`.

The `name` method defines the url prefix. E.g. if your component is
named `myio`, the webhook you can use to attach the external service is:
`http://localhost:5005/webhooks/myio/webhook` (replacing the hostname
and port with your values).
The `name` method defines the url prefix. For example, if your component is
named `myio`, the webhook you can use to attach the external service is
`http://<host>:<port>/webhooks/myio/webhook`, replacing
the host and port with the appropriate values from your running Rasa X or Rasa Open Source server.

To send a message, you would run a command like:
You can `POST` messages to your custom connector at the url
`http://<host>:<port>/webhooks/myio/webhook` using the following format:

```bash
curl -XPOST http://localhost:5005/webhooks/myio/webhook \
-d '{"sender": "user1", "message": "hello"}' \
-H "Content-type: application/json"
```json
{
"sender": "test_user", // sender ID of the user sending the message
"message": "Hi there!",
"metadata": {} // optional, any extra info you want to add for processing in NLU or custom actions
}
```

where `myio` is the name of your component.

If you need to use extra information from your front end in your custom
actions, you can add this information in the `metadata` dict of your user
message. This information will accompany the user message through the rasa
Expand All @@ -40,10 +41,8 @@ or action prediction. If you want to change the way metadata is extracted for an
existing channel, you can overwrite the function `get_metadata`. The return value
of this method will be passed to the `UserMessage`.

Here are all the attributes of `UserMessage`:

- SKIPPED CLASS DOCUMENTATION -In your implementation of the `receive` endpoint, you need to make
sure to call `on_new_message(UserMessage(text, output, sender_id))`.
In your implementation of the `receive` endpoint, you will need
to call `on_new_message(UserMessage(text, output, sender_id))`.
This will tell Rasa Core to handle this user message. The `output`
is an output channel implementing the `OutputChannel` class. You can
either implement the methods for your particular chat channel (e.g. there
Expand Down
Loading

0 comments on commit fe33091

Please sign in to comment.