Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -160,26 +160,22 @@ def handle_image_message(event):
|
|
160 |
|
161 |
# === 以下是處理解釋圖片部分 === #
|
162 |
|
163 |
-
response = client.
|
164 |
-
model="gpt-4o",
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
"
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
}
|
176 |
-
]
|
177 |
-
}
|
178 |
-
],
|
179 |
-
max_tokens=800
|
180 |
)
|
|
|
181 |
|
182 |
-
app.logger.info(response.
|
183 |
with ApiClient(configuration) as api_client:
|
184 |
line_bot_api = MessagingApi(api_client)
|
185 |
line_bot_api.reply_message(
|
|
|
160 |
|
161 |
# === 以下是處理解釋圖片部分 === #
|
162 |
|
163 |
+
response = client.responses.create(
|
164 |
+
model="gpt-4o-mini",
|
165 |
+
input=[{
|
166 |
+
"role": "user",
|
167 |
+
"content": [
|
168 |
+
{"type": "input_text", "text": "圖裏面的是什麼東西?用繁體中文描述"},
|
169 |
+
{
|
170 |
+
"type": "input_image",
|
171 |
+
"image_url": image_url,
|
172 |
+
},
|
173 |
+
],
|
174 |
+
}],
|
|
|
|
|
|
|
|
|
|
|
175 |
)
|
176 |
+
|
177 |
|
178 |
+
app.logger.info(response.output_text)
|
179 |
with ApiClient(configuration) as api_client:
|
180 |
line_bot_api = MessagingApi(api_client)
|
181 |
line_bot_api.reply_message(
|