# Custom action for custom slot mapping sanic error

**URL:** <https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869>\
**Category:** Rasa Open Source\
**Tags:** testing\
**Created:** [December 9, 2021, 7:24am UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869 "2021-12-09T07:24:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Horizon733](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/horizon733/32/20855_2.png) [@Horizon733](https://forum.rasa.com/u/Horizon733)\
**Post date:** [December 9, 2021, 7:24am UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869/1 "2021-12-09T07:24:11Z")

</div>

Hi, I was testing custom slot mapping via custom action, but it seems it is providing errors as follows.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/4/7/47c0cdf0e238145c329b1cd037abdda2e5722ce0.png)

  
Code:

```python

class ValidateTeamName(Action):
    def name(self) -> Text:
        return "action_extract_team_name"

    def run(
        self,
        dispatcher: "CollectingDispatcher",
        tracker: Tracker,
        domain: "DomainDict",
    ) -> List[Dict[Text, Any]]:
         return [SlotSet("team_name", "barcelona")]

```

Domain:

```nohighlight
slots:
  event_type_major:
    type: text
    influence_conversation: false
    mappings:
    - type: custom
      action: action_extract_team_name

actions:
- action_extract_team_name

```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 9, 2021, 9:32am UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869/2 "2021-12-09T09:32:36Z")

</div>

@Horizon733 Is this for Rasa3.0 and please share `rasa --version` , can you share us what is the sanic version and can you share the `requirements.txt` file while using `pip freeze > requirements.txt`

---

<div class="post-metadata">

**Author:** ![Horizon733](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/horizon733/32/20855_2.png) [@Horizon733](https://forum.rasa.com/u/Horizon733)\
**Post date:** [December 9, 2021, 10:05am UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869/3 "2021-12-09T10:05:22Z")

</div>

```auto
Rasa Version : 3.0.0
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.0.1
Rasa X Version : None
Python Version : 3.7.5
Operating System : Windows-10-10.0.19041-SP0
Python Path : d:\hoory\betting-bot\hoory-env\scripts\python.exe

```

---

<div class="post-metadata">

**Author:** ![Horizon733](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/horizon733/32/20855_2.png) [@Horizon733](https://forum.rasa.com/u/Horizon733)\
**Post date:** [December 9, 2021, 10:06am UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869/4 "2021-12-09T10:06:19Z")

</div>

Sanic:

```auto
sanic 21.9.3   
sanic-cors 1.0.1  
sanic-jwt 1.7.0   
sanic-plugin-toolkit 1.2.0
sanic-routing 0.7.2

```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 9, 2021, 12:02pm UTC](https://forum.rasa.com/t/custom-action-for-custom-slot-mapping-sanic-error/49869/5 "2021-12-09T12:02:03Z")

</div>

@Horizon733 can you try this:

```auto
sanic==21.6.0
Sanic-Cors==1.0.0
sanic-jwt==1.7.0
sanic-plugin-toolkit==1.2.0
Sanic-Plugins-Framework==0.9.5
sanic-routing==0.7.0

```

Always mention me as @ and nik202 for fast reply. Keep me update.
