Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,12 @@ agent = initialize_agent(
|
|
| 45 |
st.title("📈 Finance Assistant")
|
| 46 |
user_query = st.text_input("Enter your financial question:", "NFLX stock performance")
|
| 47 |
|
|
|
|
| 48 |
if st.button("Analyze"):
|
| 49 |
with st.spinner("Analyzing..."):
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
st.title("📈 Finance Assistant")
|
| 46 |
user_query = st.text_input("Enter your financial question:", "NFLX stock performance")
|
| 47 |
|
| 48 |
+
# Ensure the prompt is passed as a string
|
| 49 |
if st.button("Analyze"):
|
| 50 |
with st.spinner("Analyzing..."):
|
| 51 |
+
# Make sure user_query is passed as a string
|
| 52 |
+
if isinstance(user_query, str):
|
| 53 |
+
result = agent.run(user_query) # This will now be passed correctly as a string
|
| 54 |
+
st.markdown(result)
|
| 55 |
+
else:
|
| 56 |
+
st.error("Invalid query format. Please enter a valid question.")
|