Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,9 @@ from langchain.chains import StuffDocumentsChain
|
|
18 |
GOOGLE_API_KEY=os.environ['GOOGLE_API_KEY']
|
19 |
|
20 |
|
21 |
-
|
|
|
|
|
22 |
|
23 |
loader = WebBaseLoader(url_user)
|
24 |
docs = loader.load()
|
@@ -28,12 +30,12 @@ gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
|
28 |
llm = ChatGoogleGenerativeAI(model="gemini-pro",google_api_key = GOOGLE_API_KEY)
|
29 |
|
30 |
|
31 |
-
# user_prompt = st.text_input("Enter Prompt","
|
32 |
|
33 |
|
34 |
-
llm_prompt_template = """You are an expert Stock Market Trader for stock market insights.
|
35 |
Based on the context below
|
36 |
-
{context},
|
37 |
|
38 |
st.write(llm_prompt_template)
|
39 |
llm_prompt = PromptTemplate.from_template(llm_prompt_template)
|
|
|
18 |
GOOGLE_API_KEY=os.environ['GOOGLE_API_KEY']
|
19 |
|
20 |
|
21 |
+
ticker_user = st.text_input("Enter Ticker","ADANIENT")
|
22 |
+
|
23 |
+
url = f"https://www.google.com/finance/quote/{ticker_user}:NSE?hl=en"
|
24 |
|
25 |
loader = WebBaseLoader(url_user)
|
26 |
docs = loader.load()
|
|
|
30 |
llm = ChatGoogleGenerativeAI(model="gemini-pro",google_api_key = GOOGLE_API_KEY)
|
31 |
|
32 |
|
33 |
+
# user_prompt = st.text_input("Enter Prompt","Summarize the Stock")
|
34 |
|
35 |
|
36 |
+
llm_prompt_template = """You are an expert Stock Market Trader for stock market insights based on fundamental, analytical, profit based and company financials.
|
37 |
Based on the context below
|
38 |
+
{context}, Summarize the stock based on Historical data based on fundamental, price, news, sentiment and suggest rating of the Stock in a 1 to 10 Scale"""
|
39 |
|
40 |
st.write(llm_prompt_template)
|
41 |
llm_prompt = PromptTemplate.from_template(llm_prompt_template)
|