Skip to content

Passing images as input to an agent #727

Closed
@Bar-Korkos

Description

@Bar-Korkos

Question

How can i pass image as input to the Agents?

result = await Runner.run(
    agent,
    [
        {
            "role": "user",
            "content": [
                {
                    "type": "input_image",
                    "detail": "auto",
                    "image_url": f"data:image/jpeg;base64,{b64_image}",
                }
            ],
        },
        {
            "role": "user",
            "content": "What do you see in this image?",
        },
    ],
)

i tried this but if the image is too long it is not working, because the request is too long

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions