|
|
|
|
|
|
|
|
import streamlit as st |
|
|
from chatbot import get_bot_response |
|
|
from model_mt5 import call_mt5_model |
|
|
|
|
|
|
|
|
st.set_page_config(page_title="Chatbot Technique Multilingue", layout="centered") |
|
|
|
|
|
st.title("🤖 Chatbot de Support Technique Multilingue") |
|
|
|
|
|
st.markdown(""" |
|
|
Ce chatbot comprend **le français, l'anglais, l'espagnol et l'allemand**. |
|
|
Pose-lui une question technique ou dis simplement bonjour ! |
|
|
""") |
|
|
|
|
|
|
|
|
if "chat_history" not in st.session_state: |
|
|
st.session_state.chat_history = [] |
|
|
|
|
|
|
|
|
user_input = st.text_input("💬 Entrez votre message :", "") |
|
|
|
|
|
if user_input: |
|
|
response = get_bot_response(user_input) |
|
|
|
|
|
|
|
|
st.session_state.chat_history.append(("Vous", user_input)) |
|
|
st.session_state.chat_history.append(("Bot", response)) |
|
|
|
|
|
|
|
|
for sender, message in st.session_state.chat_history: |
|
|
if sender == "Vous": |
|
|
st.markdown(f"**🧑💻 {sender} :** {message}") |
|
|
else: |
|
|
st.markdown(f"**🤖 {sender} :** {message}") |
|
|
|