update
Browse files
app.py
CHANGED
@@ -89,15 +89,27 @@ if ticker_user!="":
|
|
89 |
if response.status_code == 200:
|
90 |
with open("chart_t1.jpg", "wb") as f:
|
91 |
f.write(response.content)
|
|
|
92 |
st.image("chart_t1.jpg", caption='')
|
93 |
# print("Image saved as chart-img-02.png")
|
94 |
else:
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
st.success('Response')
|
99 |
-
st.write(res["output_text"])
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
|
103 |
|
|
|
89 |
if response.status_code == 200:
|
90 |
with open("chart_t1.jpg", "wb") as f:
|
91 |
f.write(response.content)
|
92 |
+
|
93 |
st.image("chart_t1.jpg", caption='')
|
94 |
# print("Image saved as chart-img-02.png")
|
95 |
else:
|
96 |
+
st.write(f"Failed to retrieve image. Status code: {response.status_code}")
|
97 |
+
st.write("Response:", response.text)
|
|
|
|
|
|
|
98 |
|
99 |
+
#create the humanmassage propmt templete with the image file
|
100 |
+
hmessage = HumanMessage(
|
101 |
+
content=[
|
102 |
+
{
|
103 |
+
"type": "text",
|
104 |
+
"text": "Based on the chart, could you predict the movement and suggest a BUY and SELL Strategy",
|
105 |
+
},
|
106 |
+
{"type": "image_url", "image_url": "chart_t1.jpg"},
|
107 |
+
]
|
108 |
+
)
|
109 |
+
message = llm.invoke([hmessage])
|
110 |
+
|
111 |
+
st.write(message.content)
|
112 |
+
st.write(res["output_text"])
|
113 |
|
114 |
|
115 |
|