Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- README.md +2 -12
- app.py +38 -0
- requirement.txt +1 -0
README.md
CHANGED
|
@@ -1,12 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
emoji: 👀
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo: yellow
|
| 6 |
-
sdk: streamlit
|
| 7 |
-
sdk_version: 1.41.1
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
+
# Voiceflow Chat Assistant
|
| 2 |
+
Streamlit app with embedded Voiceflow chat widget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
|
| 4 |
+
def main():
|
| 5 |
+
st.set_page_config(
|
| 6 |
+
page_title="Chat Assistant",
|
| 7 |
+
page_icon="💬",
|
| 8 |
+
layout="wide"
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
st.title("Chat Assistant")
|
| 12 |
+
|
| 13 |
+
# Voiceflow chat widget HTML
|
| 14 |
+
voiceflow_html = """
|
| 15 |
+
<div style="height: 600px;">
|
| 16 |
+
<script type="text/javascript">
|
| 17 |
+
(function(d, t) {
|
| 18 |
+
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
|
| 19 |
+
v.onload = function() {
|
| 20 |
+
window.voiceflow.chat.load({
|
| 21 |
+
verify: { projectID: '67780033ae2ed1739d0b87bb' },
|
| 22 |
+
url: 'https://general-runtime.voiceflow.com',
|
| 23 |
+
versionID: 'production'
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs";
|
| 27 |
+
v.type = "text/javascript";
|
| 28 |
+
s.parentNode.insertBefore(v, s);
|
| 29 |
+
})(document, 'script');
|
| 30 |
+
</script>
|
| 31 |
+
</div>
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
# Inject the HTML using streamlit components
|
| 35 |
+
components.html(voiceflow_html, height=650)
|
| 36 |
+
|
| 37 |
+
if __name__ == "__main__":
|
| 38 |
+
main()
|
requirement.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
streamlit
|