- create a
custom_channels
named directory in your project's root - Add
custom_rest.py
inside that directory. - Setup
credentials.yml
- After adding
custom_rest.py
your project will look as following
MyChatbot
├───actions
from rasa_sdk import Tracker, Action | |
from typing import Any, Text | |
from rasa_sdk.executor import CollectingDispatcher | |
from rasa_sdk.types import DomainDict | |
# DO NOT copy paste whole file | |
class ActionFallback(Action): | |
def name(self) -> Text: |
FROM python:3.7.7-stretch AS BASE | |
RUN apt-get update \ | |
&& apt-get --assume-yes --no-install-recommends install \ | |
build-essential \ | |
curl \ | |
git \ | |
jq \ | |
libgomp1 \ | |
vim |
class ActionCarousel(Action): | |
def name(self) -> Text: | |
return "action_carousels" | |
def run(self, dispatcher, tracker: Tracker, domain: "DomainDict") -> List[Dict[Text, Any]]: | |
message = { | |
"type": "template", | |
"payload": { | |
"template_type": "generic", | |
"elements": [ |
package com.example.covidapp | |
import android.content.Context | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.* | |
import androidx.appcompat.app.AppCompatActivity |
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_margin="4dp"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |