my_bot_rasa / app.py
3morrrrr's picture
Update app.py
fe1f6b5 verified
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)