File size: 1,223 Bytes
09012d1
434d0b1
09012d1
 
020eba7
09012d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe1f6b5
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import streamlit as st

# Set the page title
st.set_page_config(page_title="Chatbot")

# Embed the HTML content
st.markdown("""
<!DOCTYPE html>
<html lang="en">
<body>
    <script>
        !(function () {
            let e = document.createElement("script"),
                t = document.head || document.getElementsByTagName("head")[0];
            (e.src = "https://cdn.jsdelivr.net/npm/rasa-webchat@1.x.x/lib/index.js"),
            // Replace 1.x.x with the version that you want
            (e.async = !0),
            (e.onload = () => {
                window.WebChat.default(
                    {
                        initPayload: "/init_greet",
                        customData: { language: "en" },
                        socketUrl: "http://localhost:5005",
                        title: "Mybot",
                        subtitle: "Votre Assistant Mytek",
                        inputTextFieldHint: "Tapez votre message ici",
                        // add other props here
                    },
                    null
                );
            }),
            t.insertBefore(e, t.firstChild);
        })();
        localStorage.clear();
    </script>
</body>
</html>
""", unsafe_allow_html=True)