forked from keita223/dauphine-project-iasd-2025
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
37 lines (27 loc) · 1.09 KB
/
app.py
File metadata and controls
37 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Streamlit chat interface for TelecomPlus customer support."""
import streamlit as st
from src.main import answer
st.set_page_config(page_title="TelecomPlus Support", page_icon="📱")
st.title("📱 TelecomPlus - Support Client")
st.markdown("*Assistant intelligent pour répondre à vos questions*")
# Initialize chat history
if "messages" not in st.session_state:
st.session_state.messages = []
# Display chat messages from history
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.markdown(message["content"])
# Chat input
if prompt := st.chat_input("Posez votre question..."):
# Add user message to chat history
st.session_state.messages.append({"role": "user", "content": prompt})
# Display user message
with st.chat_message("user"):
st.markdown(prompt)
# Get assistant response
with st.chat_message("assistant"):
response = answer(prompt)
st.markdown(response)
# Add assistant response to chat history
st.session_state.messages.append(
{"role": "assistant", "content": response})