Update app.py
Browse files
app.py
CHANGED
@@ -127,6 +127,16 @@ if st.session_state.logged_in:
|
|
127 |
The check marks indicate which certification and data protection eligibility each instance has.
|
128 |
You can recommend each instance according to user question if user asks about this part.
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
"""})
|
131 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
132 |
|
@@ -134,6 +144,11 @@ if st.session_state.logged_in:
|
|
134 |
bot = ChatBot()
|
135 |
bot.history = st.session_state.messages.copy() # Update history from messages
|
136 |
response = bot.generate_response(prompt)
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
# Display assistant response in chat message container
|
139 |
with st.chat_message("assistant"):
|
|
|
127 |
The check marks indicate which certification and data protection eligibility each instance has.
|
128 |
You can recommend each instance according to user question if user asks about this part.
|
129 |
|
130 |
+
Leave a message in the end to ask users whether they want to send a message. Here are
|
131 |
+
sample trigger words:
|
132 |
+
- "Send a mesage"
|
133 |
+
- "Schedule a demo"
|
134 |
+
- "I want to send a question"
|
135 |
+
|
136 |
+
If user says the the trigger words the prior message, ask for prompt in the message. Respond:
|
137 |
+
Sending message now. Message content below:
|
138 |
+
<ADD MESSAGE CONTENT HERE>
|
139 |
+
|
140 |
"""})
|
141 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
142 |
|
|
|
144 |
bot = ChatBot()
|
145 |
bot.history = st.session_state.messages.copy() # Update history from messages
|
146 |
response = bot.generate_response(prompt)
|
147 |
+
|
148 |
+
# API Call
|
149 |
+
if "send" in response or "sending" in response:
|
150 |
+
message_for_api = response.split("<")[-1].split(">")[0]
|
151 |
+
twilio_api_response = invoke_twilio_api(message_for_api)
|
152 |
|
153 |
# Display assistant response in chat message container
|
154 |
with st.chat_message("assistant"):
|