shukdevdatta123 commited on
Commit
7f12ed4
·
verified ·
1 Parent(s): 0ce5160

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- messages = [
23
- {"role": "user", "content": [{"type": "image_url", "image_url": {"url": input_text}}]}
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}]}