File size: 577 Bytes
bce1255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
import requests
from agents.voice_agent import speech_to_text, text_to_speech

st.title("🧠 Morning Market Brief - Finance Assistant")

option = st.radio("Input Mode", ["Voice", "Click Button"])
if option == "Voice":
    query = speech_to_text()
    st.write(f"You said: {query}")
else:
    if st.button("Get Morning Brief"):
        query = "What's our risk exposure in Asia tech stocks today?"

if query:
    response = requests.get("http://localhost:8000/market-brief").json()
    st.success(response['brief'])
    text_to_speech(response['brief'])