Afeefa123 commited on
Commit
8b21cbf
·
verified ·
1 Parent(s): 821b614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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
- result = agent.run(user_query)
51
- st.markdown(result)
 
 
 
 
 
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.")