You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
system_prompt="""You are an expert in image analysis. Use your experience and skills to provided a detailed description of any provided images. You should FOCUS on what info can be inferred from the image and the meaning of the data inside the image. Draw actionable insights and conclusions from the image.
166
+
167
+
If the image is a chart for instance, you should describe the data trends, patterns, and insights that can be drawn from the chart.
168
+
169
+
If the image is a map, you should describe the geographical features, landmarks, and any other relevant information that can be inferred from the map.
170
+
171
+
If the image is a diagram, you should describe the components, relationships, and any other relevant information that can be inferred from the diagram.
172
+
173
+
IMPORTANT: If the provided image is a logo or photograph, simply return 'Irrelevant Image'."""
174
+
175
+
user_input="Describe this image with technical analysis. Provide a well-structured, description."
176
+
177
+
ifcaption!="":
178
+
user_input+=f" (note: it has image caption: {caption})"
# We send both image caption and the image body to GPTv for better understanding
173
-
ifcaption!="":
174
-
response=awaitclient.chat.completions.create(
175
-
model=model,
176
-
messages=[
177
-
{
178
-
"role": "system",
179
-
"content": "You are an expert in image analysis. Use your experience and skills to provided a detailed description of any provided images. You should focus on what info can be inferred from the image and the meaning of the data inside the image.",
180
-
},
181
-
{
182
-
"role": "user",
183
-
"content": [
184
-
{
185
-
"type": "text",
186
-
"text": f"Describe this image with technical analysis. Provide a well-structured, description. IMPORTANT: If the provided image is a logo or photograph, simply return 'Irrelevant Image'. (note: it has image caption: {caption}):",
187
-
},
188
-
{
189
-
"type": "image_url",
190
-
"image_url": {
191
-
"url": f"data:image/png;base64,{image_base64}"
192
-
},
193
-
},
194
-
],
195
-
},
196
-
],
197
-
max_tokens=MAX_TOKENS,
198
-
)
199
-
200
-
else:
201
-
response=awaitclient.chat.completions.create(
202
-
model=model,
203
-
messages=[
204
-
{
205
-
"role": "system",
206
-
"content": "You are an expert in image analysis. Use your experience and skills to provided a detailed description of any provided images. You should focus on what info can be inferred from the image and the meaning of the data inside the image.",
207
-
},
208
-
{
209
-
"role": "user",
210
-
"content": [
211
-
{
212
-
"type": "text",
213
-
"text": "Describe this image with technical analysis. Provide a well-structured, description. IMPORTANT: If the provided image is a logo or photograph, simply return 'Irrelevant Image'.",
0 commit comments