Mehrdad Javadi
Update app.py
6178b8d verified
raw
history blame contribute delete
No virus
1.75 kB
import streamlit as st
from utils import transcribe_audio, send_summary_email
# Define the Streamlit app
def main():
st.title("Customer Care Call Summarization")
# Upload multiple files
uploaded_files = st.file_uploader("Upload recorded .mp3 files", type=["mp3"], accept_multiple_files=True)
if uploaded_files:
st.write("Uploaded Files:")
for uploaded_file in uploaded_files:
file_name = uploaded_file.name
col1, col2, col3 = st.columns([0.1, 1, 2])
with col1:
st.write("-")
with col2:
st.write(file_name)
with col3:
transcribe_button = st.button(f"Transcribe {file_name}", key=file_name)
if transcribe_button:
with st.spinner('Transcribing...'):
transcribed_text = transcribe_audio(uploaded_file)
st.write(f"### Transcribed Text for {file_name}")
st.write(transcribed_text)
# Show summary before sending email
summary = f"Send an Email to mehrdaddjavadi@gmail.com via gmail summarizing the following text provided below: {transcribed_text}"
st.write("### Summary")
st.write(summary)
send_button = st.button(f"Send Email for {file_name}", key=f"send_{file_name}")
if send_button:
with st.spinner('Sending email...'):
send_summary_email(transcribed_text)
st.success(f"Sent email for: {file_name}")
# Run the Streamlit app
if __name__ == "__main__":
main()