chatbot implemented on the main app
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
# limitations under the License.
|
14 |
|
15 |
import streamlit as st
|
16 |
-
|
17 |
|
18 |
def run():
|
19 |
st.set_page_config(page_title="Momentum-Strategy", page_icon="💹", layout="wide")
|
@@ -27,7 +27,16 @@ def run():
|
|
27 |
# Stock Return Simulation App
|
28 |
|
29 |
This application is a return simulation tool for selected stocks. It allows users to simulate returns based on a momentum strategy using the 4th factor from the Carhart 4-factor model. The application automatically downloads stock data from Yahoo Finance live when the user presses the button, ensuring that the data is always refreshed to the most recent trading day records.
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
## Usage
|
32 |
|
33 |
1. **Downloading Data**: Click the "Download Data" button to fetch stock data from Yahoo Finance live. This action ensures that the data is up-to-date with the most recent trading day records.
|
|
|
13 |
# limitations under the License.
|
14 |
|
15 |
import streamlit as st
|
16 |
+
from utils.helper import *
|
17 |
|
18 |
def run():
|
19 |
st.set_page_config(page_title="Momentum-Strategy", page_icon="💹", layout="wide")
|
|
|
27 |
# Stock Return Simulation App
|
28 |
|
29 |
This application is a return simulation tool for selected stocks. It allows users to simulate returns based on a momentum strategy using the 4th factor from the Carhart 4-factor model. The application automatically downloads stock data from Yahoo Finance live when the user presses the button, ensuring that the data is always refreshed to the most recent trading day records.
|
30 |
+
"""
|
31 |
+
)
|
32 |
+
|
33 |
+
with st.expander("Please expand/collapse to chat with an AI advisor:"):
|
34 |
+
user_question = st.text_input('Enter a question:', 'What does the company NVIDIA do?')
|
35 |
+
ai_answer = run_langchain_agent_(question=user_question)
|
36 |
+
st.markdown(ai_answer)
|
37 |
+
|
38 |
+
st.markdown(
|
39 |
+
"""
|
40 |
## Usage
|
41 |
|
42 |
1. **Downloading Data**: Click the "Download Data" button to fetch stock data from Yahoo Finance live. This action ensures that the data is up-to-date with the most recent trading day records.
|