Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,10 @@ from langchain.chains import StuffDocumentsChain
|
|
17 |
|
18 |
GOOGLE_API_KEY=os.environ['GOOGLE_API_KEY']
|
19 |
|
20 |
-
|
|
|
|
|
|
|
21 |
docs = loader.load()
|
22 |
|
23 |
gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
@@ -28,7 +31,7 @@ llm = ChatGoogleGenerativeAI(model="gemini-pro",google_api_key = GOOGLE_API_KEY)
|
|
28 |
# user_prompt = st.text_input("Enter Prompt","What is the best stocks for the next few weeks")
|
29 |
|
30 |
|
31 |
-
llm_prompt_template = """You are an
|
32 |
Based on the context below
|
33 |
{context}, Suggest some stocks recommendations"""
|
34 |
|
@@ -40,7 +43,7 @@ stuff_chain = StuffDocumentsChain(llm_chain=llm_chain,document_variable_name="co
|
|
40 |
|
41 |
|
42 |
res = stuff_chain.invoke(docs)
|
43 |
-
st.write(res)
|
44 |
|
45 |
# If there is no environment variable set for the API key, you can pass the API
|
46 |
# key to the parameter `google_api_key` of the `GoogleGenerativeAIEmbeddings`
|
|
|
17 |
|
18 |
GOOGLE_API_KEY=os.environ['GOOGLE_API_KEY']
|
19 |
|
20 |
+
|
21 |
+
url_user = st.text_input("Enter Url","https://www.moneycontrol.com/stocksmarketsindia/")
|
22 |
+
|
23 |
+
loader = WebBaseLoader(url_user)
|
24 |
docs = loader.load()
|
25 |
|
26 |
gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
|
|
31 |
# user_prompt = st.text_input("Enter Prompt","What is the best stocks for the next few weeks")
|
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}, Suggest some stocks recommendations"""
|
37 |
|
|
|
43 |
|
44 |
|
45 |
res = stuff_chain.invoke(docs)
|
46 |
+
st.write(res.output_text)
|
47 |
|
48 |
# If there is no environment variable set for the API key, you can pass the API
|
49 |
# key to the parameter `google_api_key` of the `GoogleGenerativeAIEmbeddings`
|