Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import requests
|
3 |
+
from agents.voice_agent import speech_to_text, text_to_speech
|
4 |
+
|
5 |
+
st.title("🧠 Morning Market Brief - Finance Assistant")
|
6 |
+
|
7 |
+
option = st.radio("Input Mode", ["Voice", "Click Button"])
|
8 |
+
if option == "Voice":
|
9 |
+
query = speech_to_text()
|
10 |
+
st.write(f"You said: {query}")
|
11 |
+
else:
|
12 |
+
if st.button("Get Morning Brief"):
|
13 |
+
query = "What's our risk exposure in Asia tech stocks today?"
|
14 |
+
|
15 |
+
if query:
|
16 |
+
response = requests.get("http://localhost:8000/market-brief").json()
|
17 |
+
st.success(response['brief'])
|
18 |
+
text_to_speech(response['brief'])
|