Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ st.sidebar.info("Know more about [Charts](https://chart-img.com/)")
|
|
28 |
ticker_user = st.text_input("Enter Ticker for NSE Stocks","")
|
29 |
gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
30 |
|
31 |
-
llm = ChatGoogleGenerativeAI(model="gemini-1.5-pro
|
32 |
llm_vis = ChatGoogleGenerativeAI(model="gemini-pro-vision",google_api_key = GOOGLE_API_KEY)
|
33 |
if ticker_user!="":
|
34 |
url1 = f"https://www.google.com/finance/quote/{ticker_user}:NSE?hl=en"
|
@@ -64,7 +64,7 @@ if ticker_user!="":
|
|
64 |
PROVIDE THE DETAILS IN an JSON Object
|
65 |
"""
|
66 |
|
67 |
-
st.sidebar.subheader('Prompt')
|
68 |
# user_prompt = st.sidebar.text_area("Enter Prompt",llm_prompt_template)
|
69 |
|
70 |
url = "https://api.chart-img.com/v2/tradingview/advanced-chart"
|
@@ -98,18 +98,18 @@ if ticker_user!="":
|
|
98 |
res = stuff_chain.invoke(docs)
|
99 |
|
100 |
#create the humanmassage propmt templete with the image file
|
101 |
-
hmessage = HumanMessage(
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
)
|
110 |
-
message = llm_vis.invoke([hmessage])
|
111 |
|
112 |
-
st.write(message.content)
|
113 |
st.write(res["output_text"])
|
114 |
|
115 |
# print("Image saved as chart-img-02.png")
|
|
|
28 |
ticker_user = st.text_input("Enter Ticker for NSE Stocks","")
|
29 |
gemini_embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
30 |
|
31 |
+
llm = ChatGoogleGenerativeAI(model="gemini-1.5-pro",google_api_key = GOOGLE_API_KEY)
|
32 |
llm_vis = ChatGoogleGenerativeAI(model="gemini-pro-vision",google_api_key = GOOGLE_API_KEY)
|
33 |
if ticker_user!="":
|
34 |
url1 = f"https://www.google.com/finance/quote/{ticker_user}:NSE?hl=en"
|
|
|
64 |
PROVIDE THE DETAILS IN an JSON Object
|
65 |
"""
|
66 |
|
67 |
+
# st.sidebar.subheader('Prompt')
|
68 |
# user_prompt = st.sidebar.text_area("Enter Prompt",llm_prompt_template)
|
69 |
|
70 |
url = "https://api.chart-img.com/v2/tradingview/advanced-chart"
|
|
|
98 |
res = stuff_chain.invoke(docs)
|
99 |
|
100 |
#create the humanmassage propmt templete with the image file
|
101 |
+
# hmessage = HumanMessage(
|
102 |
+
# content=[
|
103 |
+
# {
|
104 |
+
# "type": "text",
|
105 |
+
# "text": "Based on the Image, suggest a BUY and SELL Strategy along with Risk based approach using Stop loss/Target price. PROVIDE THE DETAILS based on just the FACTS present and PROVIDE THE DETAILS IN an JSON Object",
|
106 |
+
# },
|
107 |
+
# {"type": "image_url", "image_url": "chart_t1.jpg"},
|
108 |
+
# ]
|
109 |
+
# )
|
110 |
+
# message = llm_vis.invoke([hmessage])
|
111 |
|
112 |
+
# st.write(message.content)
|
113 |
st.write(res["output_text"])
|
114 |
|
115 |
# print("Image saved as chart-img-02.png")
|