Update app.py
Browse files
app.py
CHANGED
@@ -19,9 +19,14 @@ def generate_response(input_text, image, openai_api_key, reasoning_effort="mediu
|
|
19 |
|
20 |
# Prepare the messages for OpenAI API
|
21 |
if model_choice == "o1":
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
elif model_choice == "o3-mini":
|
26 |
messages = [
|
27 |
{"role": "user", "content": [{"type": "text", "text": input_text}]}
|
|
|
19 |
|
20 |
# Prepare the messages for OpenAI API
|
21 |
if model_choice == "o1":
|
22 |
+
if image:
|
23 |
+
messages = [
|
24 |
+
{"role": "user", "content": [{"type": "image_url", "image_url": {"url": input_text}}]}
|
25 |
+
]
|
26 |
+
else:
|
27 |
+
messages = [
|
28 |
+
{"role": "user", "content": [{"type": "text", "text": input_text}]}
|
29 |
+
]
|
30 |
elif model_choice == "o3-mini":
|
31 |
messages = [
|
32 |
{"role": "user", "content": [{"type": "text", "text": input_text}]}
|