Skip to content

Commit

Permalink
AUTO docusaurus 20230721
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub CI committed Jul 21, 2023
1 parent 7181240 commit afde62f
Show file tree
Hide file tree
Showing 34 changed files with 1,211 additions and 343 deletions.
3 changes: 3 additions & 0 deletions .typo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,8 @@ excluded_words:
- anonymization
- anonymized
- dslim
- pluggy
- HookimplMarker
- hookimpl

spellcheck_filenames: false
28 changes: 28 additions & 0 deletions CHANGELOG.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ https://github.com/RasaHQ/rasa/tree/main/changelog/ . -->

<!-- TOWNCRIER -->

## [3.6.4] - 2023-07-21

Rasa 3.6.4 (2023-07-21)
### Bugfixes
- [#12575](https://github.com/rasahq/rasa/issues/12575): Extract conditional response variation and channel variation filtering logic into a separate component.
Enable usage of this component in the NaturalLanguageGenerator subclasses (e.g. CallbackNaturalLanguageGenerator, TemplatedNaturalLanguageGenerator).
Amend nlg_request_format to include a single response ID string field, instead of a list of IDs.

### Improved Documentation
- [#12663](https://github.com/rasahq/rasa/issues/12663): Updated commands with square brackets e.g (`pip install rasa[spacy]`) to use quotes (`pip install 'rasa[spacy]'`) for compatibility with zsh in docs.


## [3.6.3] - 2023-07-20

Rasa 3.6.3 (2023-07-20)
### Improvements
- [#12637](https://github.com/rasahq/rasa/issues/12637): Added a human readable component to structlog using the `event_info` key and made it the default rendered key if present.

### Bugfixes
- [#12638](https://github.com/rasahq/rasa/issues/12638): Fix the issue with the most recent model not being selected if the owner or permissions where modified on the model file.
- [#12661](https://github.com/rasahq/rasa/issues/12661): Fixed `BlockingIOError` which occured as a result of too large data passed to strulogs.

### Improved Documentation
- [#12659](https://github.com/rasahq/rasa/issues/12659): Update action server documentation with new capability to extend Sanic features by using plugins.
Update rasa-sdk dependency to version 3.6.1.
- [#12663](https://github.com/rasahq/rasa/issues/12663): Updated commands with square brackets e.g (`pip install rasa[spacy]`) to use quotes (`pip install 'rasa[spacy]'`) for compatibility with zsh in docs.


## [3.6.2] - 2023-07-06

Rasa 3.6.2 (2023-07-06)
Expand Down
63 changes: 63 additions & 0 deletions data/test_nlg/domain_with_response_ids.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: "3.1"

intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge

entities:
- name


slots:
name:
type: text
mappings:
- type: from_entity
entity: name
logged_in:
type: bool
influence_conversation: false
mappings:
- type: custom

responses:
utter_greet:
- text: "Hey! How are you?"
buttons:
- title: "great"
payload: "/mood_great"
- title: "super sad"
payload: "/mood_unhappy"
id: "ID_1"

- text: "Welcome back {name}! How are you?"
id: "ID_2"
condition:
- type: slot
name: logged_in
value: true

utter_cheer_up:
- text: "Here is something to cheer you up:"
image: "https://i.imgur.com/nGF1K8f.jpg"

utter_did_that_help:
- text: "Did that help you?"

utter_happy:
- text: "Great, carry on!"

utter_goodbye:
- text: "Bye"

utter_iamabot:
- text: "I am a bot, powered by Rasa."

session_config:
session_expiration_time: 60 # value in minutes
carry_over_slots_to_new_session: true
67 changes: 67 additions & 0 deletions docs/docs/action-server/sanic-extensions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
id: sanic-extensions
sidebar_label: Sanic Extensions
title: Sanic Extensions
---

:::info New in 3.6

You can now extend Sanic features such as middlewares, listeners, background tasks
and additional routes.

:::


You can now create additional Sanic extensions by accessing the app object created by the action server. The hook implemented
in the plugin package provides you access to the Sanic app object created by `rasa-sdk` when starting the action server.

## Step-by-step guide on creating your own Sanic extension in rasa_sdk
This example will show you how to create a Sanic listener using plugins.

### Create the rasa_sdk_plugins package
Create a package in your action server project which you must name `rasa_sdk_plugins`. Rasa SDK will try to instantiate this package in your project to start plugins.
If no plugins are found, it will print a debug log that there are no plugins in your project.

### Register modules containing the hooks
Create the package `rasa_sdk_plugins` and initialize the hooks by creating an `__init__.py` file where the plugin manager will look for the module where the hooks are implemented:

```
def init_hooks(manager: pluggy.PluginManager) -> None:
"""Initialise hooks into rasa sdk."""
import sys
import rasa_sdk_plugins.your_module
logger.info("Finding hooks")
manager.register(sys.modules["rasa_sdk_plugins.your_module"])
```
### Implement your hook
Implement the hook `attach_sanic_app_extensions`. This hook forwards the app object created by Sanic in the `rasa_sdk` and allows you to create additional routes, middlewares, listeners and background tasks. Here's an example of this implementation that creates a listener.

In your `rasa_sdk_plugins.your_module.py`:

```
from __future__ import annotations
import logging
import pluggy
from asyncio import AbstractEventLoop
from functools import partial
logger = logging.getLogger(__name__)
hookimpl = pluggy.HookimplMarker("rasa_sdk")
@hookimpl # type: ignore[misc]
def attach_sanic_app_extensions(app: Sanic) -> None:
logger.info("hook called")
app.register_listener(
partial(before_server_start),
"before_server_start",
)
async def before_server_start(app: Sanic, loop: AbstractEventLoop):
logger.info("BEFORE SERVER START")
```
28 changes: 28 additions & 0 deletions docs/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ https://github.com/RasaHQ/rasa/tree/main/changelog/ . -->

<!-- TOWNCRIER -->

## [3.6.4] - 2023-07-21

Rasa 3.6.4 (2023-07-21)
### Bugfixes
- [#12575](https://github.com/rasahq/rasa/issues/12575): Extract conditional response variation and channel variation filtering logic into a separate component.
Enable usage of this component in the NaturalLanguageGenerator subclasses (e.g. CallbackNaturalLanguageGenerator, TemplatedNaturalLanguageGenerator).
Amend nlg_request_format to include a single response ID string field, instead of a list of IDs.

### Improved Documentation
- [#12663](https://github.com/rasahq/rasa/issues/12663): Updated commands with square brackets e.g (`pip install rasa[spacy]`) to use quotes (`pip install 'rasa[spacy]'`) for compatibility with zsh in docs.


## [3.6.3] - 2023-07-20

Rasa 3.6.3 (2023-07-20)
### Improvements
- [#12637](https://github.com/rasahq/rasa/issues/12637): Added a human readable component to structlog using the `event_info` key and made it the default rendered key if present.

Check warning on line 35 in docs/docs/changelog.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

structlog

"structlog" is a typo. Did you mean "structural"?

### Bugfixes
- [#12638](https://github.com/rasahq/rasa/issues/12638): Fix the issue with the most recent model not being selected if the owner or permissions where modified on the model file.
- [#12661](https://github.com/rasahq/rasa/issues/12661): Fixed `BlockingIOError` which occured as a result of too large data passed to strulogs.

Check warning on line 39 in docs/docs/changelog.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

occured

"occured" is a typo. Did you mean "occurred"?

Check warning on line 39 in docs/docs/changelog.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

strulogs

"strulogs" is a typo. Did you mean "stridulous"?

### Improved Documentation
- [#12659](https://github.com/rasahq/rasa/issues/12659): Update action server documentation with new capability to extend Sanic features by using plugins.
Update rasa-sdk dependency to version 3.6.1.
- [#12663](https://github.com/rasahq/rasa/issues/12663): Updated commands with square brackets e.g (`pip install rasa[spacy]`) to use quotes (`pip install 'rasa[spacy]'`) for compatibility with zsh in docs.


## [3.6.2] - 2023-07-06

Rasa 3.6.2 (2023-07-06)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/installation/environment-set-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Rasa installations on Apple Silicon _don't_ use [Apple Metal](https://developer.
We found that using the GPU on Apple Silicon increased training time for the
[`DIETClassifier`](../components.mdx#dietclassifier) and [`TEDPolicy`](../policies.mdx#ted-policy) dramatically.
You can, however, install the optional dependency to test it yourself
or try it with other components using: `pip3 install rasa[metal]`.
or try it with other components using: `pip3 install 'rasa[metal]'`.

Currently, not all of Rasa's dependencies support Apple Silicon natively. This leads
to the following restrictions:
Expand Down
17 changes: 14 additions & 3 deletions docs/docs/installation/installing-rasa-open-source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ configuration for your assistant and alert you to additional dependencies.
If you don't mind the additional dependencies lying around, you can use

```bash
pip3 install rasa[full]
pip3 install 'rasa[full]'
```

to install all needed dependencies for every configuration.
Expand Down Expand Up @@ -141,10 +141,21 @@ For more information on spaCy models, check out the [spaCy docs](https://spacy.i
You can install it with the following commands:

```bash
pip3 install rasa[spacy]
pip3 install 'rasa[spacy]'
python3 -m spacy download en_core_web_md
```

:::tip Using `zsh`?

In zsh, square brackets are interpreted as patterns on the command line.
To run commands with square brackets, you can either enclose the arguments
with square brackets in quotes, like `pip3 install 'rasa[spacy]'`, or escape
the square brackets using backslashes, like `pip3 install rasa\[spacy\]`.
We recommend using the former method (`pip3 install 'rasa[spacy]'`) in our
documentation because it works as expected across any shell

:::

This will install Rasa Open Source as well as spaCy and its language model
for the English language, but many other languages are available too.
We recommend using at least the "medium" sized models (`_md`) instead of the spaCy's
Expand All @@ -157,7 +168,7 @@ First, run

```bash
pip3 install git+https://github.com/mit-nlp/MITIE.git
pip3 install rasa[mitie]
pip3 install 'rasa[mitie]'
```

and then download the
Expand Down
11 changes: 4 additions & 7 deletions docs/docs/nlg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ The body of the `POST` request sent to your NLG endpoint will be structured
like this:

:::info New in 3.6
We have added an `ids` field to the request body.
This field contains a list of response variation IDs.
We have added an `id` field to the request body.
This field contains the ID of the response variation.
You can use this information to compose/select a proper response variation on your NLG server.
In case you are using responses with Conditional Response Variations,
on the NLG server side, you must implement the logic which will use content of the slots from
`tracker['slots']` along side the IDs from `ids` field to select the proper response variation.

:::

Expand All @@ -42,7 +39,7 @@ on the NLG server side, you must implement the logic which will use content of t
"arguments":{

},
"ids": ["<response_variation_id_1>", "<response_variation_id_2>"],
"id": "<response_variation_id>",
"tracker":{
"sender_id":"user_0",
"slots":{
Expand Down Expand Up @@ -182,7 +179,7 @@ Here is an overview of the high-level keys in the post request:
Key | Description
---|---
`response` | The name of the response predicted by Rasa.
`ids` | A list of response variation IDs.
`id` | An optional string representing the response variation ID, can be null.
`arguments` | Optional keyword arguments that can be provided by custom actions.
`tracker` | A dictionary containing the entire conversation history.
`channel` | The output channel this message will be sent to.
Expand Down
15 changes: 15 additions & 0 deletions docs/docs/reference/rasa/core/nlg/callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,18 @@ def validate_response(content: Optional[Dict[Text, Any]]) -> bool

Validate the NLG response. Raises exception on failure.

#### fetch\_response\_id

```python
@staticmethod
def fetch_response_id(
utter_action: Text, tracker: DialogueStateTracker, output_channel: Text,
domain_responses: Optional[Dict[Text, List[Dict[Text, Any]]]]
) -> Optional[Text]
```

Fetch the response id for the utter action.

The response id is retrieved from the domain responses for the
utter action given the tracker state and channel.

31 changes: 31 additions & 0 deletions docs/docs/reference/rasa/core/nlg/generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,34 @@ def create(obj: Union["NaturalLanguageGenerator", EndpointConfig, None],

Factory to create a generator.

## ResponseVariationFilter Objects

```python
class ResponseVariationFilter()
```

Filters response variations based on the channel, action and condition.

#### responses\_for\_utter\_action

```python
def responses_for_utter_action(
utter_action: Text, output_channel: Text,
filled_slots: Dict[Text, Any]) -> List[Dict[Text, Any]]
```

Returns array of responses that fit the channel, action and condition.

#### get\_response\_variation\_id

```python
def get_response_variation_id(utter_action: Text,
tracker: DialogueStateTracker,
output_channel: Text) -> Optional[Text]
```

Returns the first matched response variation ID.

This ID corresponds to the response variation that fits
the channel, action and condition.

19 changes: 19 additions & 0 deletions docs/docs/reference/rasa/shared/core/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ A session start sequence is a sequence of two events: an executed
Whether `events` begins with a session start sequence.
#### remove\_parse\_data
```python
def remove_parse_data(event: Dict[Text, Any]) -> Dict[Text, Any]
```
Reduce event details to the minimum necessary to be structlogged.
Deletes the parse_data key from the event if it exists.
**Arguments**:
- `event` - The event to be reduced.
**Returns**:
A reduced copy of the event.
## Event Objects
```python
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_interactive___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ options:
--conversation-id CONVERSATION_ID
Specify the id of the conversation the messages are
in. Defaults to a UUID that will be randomly
generated. (default: 0cd6d9eaff4349da8ec7ce2eaad8baba)
generated. (default: ab5ad5697bc14e1c948bfc69b031990a)
--endpoints ENDPOINTS
Configuration file for the model server and the
connectors as a yml file. (default: endpoints.yml)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_shell___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ options:
-h, --help show this help message and exit
--conversation-id CONVERSATION_ID
Set the conversation ID. (default:
dd5f96c67e5445f5be2dc42ac8b666b6)
0d35abe5f8254e4a9b0ca0db6f53e7b2)
-m MODEL, --model MODEL
Path to a trained Rasa model. If a directory is
specified, it will use the latest model in this
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/variables.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"release": "3.7.0b2",
"rasa_sdk_version": "3.7.0b1"
"release": "3.6.4",
"rasa_sdk_version": "3.6.1"
}

0 comments on commit afde62f

Please sign in to comment.