To upload files, please first save the app
import streamlit as st
from streamlit_chat_widget import chat_input_widget
def app():
st.title("Doctor AI Assistant")
if "chat_history" not in st.session_state:
st.session_state.chat_history = [
"Hello! I am your Doctor AI Assistant. How can I help you?"
]
# Display chat history
for message in st.session_state.chat_history:
st.write(message)
# Display the chat input widget at the bottom
response = chat_input_widget()
if response:
if "text" in response:
user_text = response["text"]
st.session_state.chat_history.append(f"You: {user_text}")
elif "audioFile" in response:
audio_bytes = bytes(response["audioFile"])
st.audio(audio_bytes)
if __name__ == "__main__":
app()
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?