blazingbunny commited on
Commit
3c9b732
·
verified ·
1 Parent(s): f170669

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -12
app.py CHANGED
@@ -6,7 +6,24 @@ import urllib.parse
6
  import urllib.request
7
  import pandas as pd
8
 
9
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
 
12
 
@@ -66,17 +83,7 @@ st.sidebar.markdown("""
66
  4. **View Results**: See the identified entities and their details.
67
  5. **Export Entities**: Export the entities as JSON or CSV.
68
  """)
69
- # Embed JavaScript chatbot code using Streamlit components with a visible height
70
- st.components.v1.html("""
71
- <script src="https://cm36cv1ly1jf0za4zge3j22h8.agent.pa.smyth.ai/static/embodiment/chatBot/chatbot-v2.js"></script>
72
- <script>
73
- ChatBot.init({
74
- domain: 'cm36cv1ly1jf0za4zge3j22h8.agent.pa.smyth.ai',
75
- introMessage: 'Hello, how can I assist you today?',
76
- // additional settings, such as colors
77
- });
78
- </script>
79
- """, height=200) # Set height to 200 for visibility
80
 
81
 
82
  # Header and intro
 
6
  import urllib.request
7
  import pandas as pd
8
 
9
+ st.components.v1.html("""
10
+ <script src="https://cm36cv1ly1jf0za4zge3j22h8.agent.pa.smyth.ai/static/embodiment/chatBot/chatbot-v2.js"
11
+ onload="console.log('Chatbot script loaded successfully')"
12
+ onerror="console.log('Chatbot script failed to load')"></script>
13
+ <script>
14
+ setTimeout(() => {
15
+ if (typeof ChatBot !== 'undefined') {
16
+ ChatBot.init({
17
+ domain: 'cm36cv1ly1jf0za4zge3j22h8.agent.pa.smyth.ai',
18
+ introMessage: 'Hello, how can I assist you today?',
19
+ // additional settings
20
+ });
21
+ } else {
22
+ console.error('ChatBot is not defined');
23
+ }
24
+ }, 1000); // Delay to ensure script has time to load
25
+ </script>
26
+ """, height=200)
27
 
28
 
29
 
 
83
  4. **View Results**: See the identified entities and their details.
84
  5. **Export Entities**: Export the entities as JSON or CSV.
85
  """)
86
+
 
 
 
 
 
 
 
 
 
 
87
 
88
 
89
  # Header and intro