#!/usr/bin/env python3
from openai import OpenAI
from dotenv import load_dotenv
import base64

load_dotenv()
client = OpenAI()

# Read and encode image
with open("sample.jpg", "rb") as f:
    image_data = base64.b64encode(f.read()).decode("utf-8")

response = client.responses.create(
    model = "gpt-5-mini",
    input = [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_image",
                    "image_url": f"data:image/jpeg;base64,{image_data}"
                },
                {
                    "type": "input_text",
                    "text": """Describe this image in detail.
                               Try to guess where the photo has been taken."""
                }
            ]
        }
    ]
)

print(response.output_text)
