Spaces:
Sleeping
Sleeping
Demosthene-OR
commited on
Commit
•
227a556
1
Parent(s):
6c15782
Update chatbot_tab.py
Browse files- tabs/chatbot_tab.py +30 -2
tabs/chatbot_tab.py
CHANGED
@@ -229,7 +229,7 @@ def play_audio(custom_sentence, Lang_target, speed=1.0):
|
|
229 |
new_audio_stream_bytesio.seek(0)
|
230 |
|
231 |
# Lire l'audio dans Streamlit
|
232 |
-
time.sleep(2)
|
233 |
st.audio(new_audio_stream_bytesio, start_time=0, autoplay=True)
|
234 |
|
235 |
|
@@ -267,7 +267,7 @@ def run():
|
|
267 |
config,thread_id = init()
|
268 |
query = ""
|
269 |
st.button(label=tr("Validez"), type="primary")
|
270 |
-
|
271 |
try:
|
272 |
config
|
273 |
# On ne fait rien
|
@@ -369,8 +369,36 @@ def run():
|
|
369 |
for message in st.session_state.messages:
|
370 |
with st.chat_message(message["role"]):
|
371 |
st.markdown(message["content"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
|
|
|
373 |
st.write("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
st.write("")
|
|
|
|
|
375 |
st.write("")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
st.write("")
|
|
|
229 |
new_audio_stream_bytesio.seek(0)
|
230 |
|
231 |
# Lire l'audio dans Streamlit
|
232 |
+
# time.sleep(2)
|
233 |
st.audio(new_audio_stream_bytesio, start_time=0, autoplay=True)
|
234 |
|
235 |
|
|
|
267 |
config,thread_id = init()
|
268 |
query = ""
|
269 |
st.button(label=tr("Validez"), type="primary")
|
270 |
+
elif (chosen_id == "tab2"):
|
271 |
try:
|
272 |
config
|
273 |
# On ne fait rien
|
|
|
369 |
for message in st.session_state.messages:
|
370 |
with st.chat_message(message["role"]):
|
371 |
st.markdown(message["content"])
|
372 |
+
else:
|
373 |
+
st.write("")
|
374 |
+
st.write("")
|
375 |
+
q1 = st.text_input(label="", value=tr("Combien le vendeur a-t-il posé de questions ouvertes ?"),label_visibility="collapsed")
|
376 |
+
output = app.invoke(
|
377 |
+
{"messages": q1,"language": language},
|
378 |
+
config,
|
379 |
+
)
|
380 |
+
custom_sentence = output["messages"][-1].content
|
381 |
+
st.write(custom_sentence)
|
382 |
+
st.write("")
|
383 |
|
384 |
+
st.divider()
|
385 |
st.write("")
|
386 |
+
q2 = st.text_input(label="", value=tr(f"Quel est le % de temps de parole du prospect ?"),label_visibility="collapsed")
|
387 |
+
output = app.invoke(
|
388 |
+
{"messages": q2,"language": language},
|
389 |
+
config,
|
390 |
+
)
|
391 |
+
custom_sentence = output["messages"][-1].content
|
392 |
+
st.write(custom_sentence)
|
393 |
st.write("")
|
394 |
+
|
395 |
+
st.divider()
|
396 |
st.write("")
|
397 |
+
q3 = st.text_input(label="", value=tr("Peux tu me donner une analyse succinte de la tonalité du vendeur ?"),label_visibility="collapsed")
|
398 |
+
output = app.invoke(
|
399 |
+
{"messages": q3,"language": language},
|
400 |
+
config,
|
401 |
+
)
|
402 |
+
custom_sentence = output["messages"][-1].content
|
403 |
+
st.write(custom_sentence)
|
404 |
st.write("")
|