rajat5ranjan commited on
Commit
a8d0d55
·
verified ·
1 Parent(s): 40e2175
Files changed (1) hide show
  1. app.py +17 -5
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
- print(f"Failed to retrieve image. Status code: {response.status_code}")
96
- print("Response:", response.text)
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