import streamlit as st import streamlit_chat as stc import uuid from helper import get_data, convert_url, collection st.set_page_config(layout="wide") option = st.sidebar.selectbox( placeholder="Choose an MP3...", label="**MP3**", options=collection.distinct("mp3"), index=None, ) if option: st.title("Get Call Analysis Data") st.audio(convert_url(option), start_time=0, format='audio/mp3') data = get_data(option) mp3 = data["mp3"] transcript = data["transcript"] summary = data["summary"] ratings = data["ratings"] cost = data["cost"] col1, col2 = st.columns(2) with col1: st.title( "Ratings", help="The ratings given by the AI based on your prompts" ) col31, col32, col33 = st.columns(3) with col31: st.text_input( label="**Rudeness or politeness metric**", value=ratings["rudeness_or_politeness_metric"], disabled=True, ) st.text_input( label="**Salesperson company introduction**", value=ratings["salesperson_company_introduction"], disabled=True, ) st.text_input( label="**Meeting request**", value=ratings["meeting_request"], disabled=True, ) with col32: st.text_input( label="**Salesperson's convincing abilities**", value=ratings["salesperson_convincing_abilities"], disabled=True, ) st.text_input( label="**Understanding of requirements**", value=ratings["salesperson_understanding_of_customer_requirements"], disabled=True, ) st.text_input( label="**Customer sentiment**", value=ratings["customer_sentiment_by_the_end_of_call"], disabled=True, ) with col33: st.text_input( label="**Customer's eagerness to buy**", value=ratings["customer_eagerness_to_buy"], disabled=True, ) st.text_input( label="**Customer's budget**", value=ratings["customer_budget"], disabled=True, ) st.text_input( label="**Customer preferences**", value=ratings["customer_preferences"], disabled=True, ) st.text_input(label="Cost", value=cost, disabled=True) st.title("Meeting Notes", help="The call summary") st.markdown(f"## {summary['title']}") # Display discussion points st.markdown("### Discussion Points") st.markdown(summary["discussion_points"]) # Display customer queries st.markdown("### Customer Queries") st.markdown(summary["customer_queries"]) # Display next action items st.markdown("### Next Action Items") st.markdown(summary["next_action_items"]) with col2: st.title( "Diarized Output", help="This conversation comes from the deepgram API" ) with st.expander(label="View the Raw Transcript"): st.text_area( label="Raw Transcript", value=transcript, height=450, ) for i in transcript.split("\n"): if "salesperson" in i: temp = i.replace("salesperson", "").replace(":", "") st.write( f"""