https://promptfoo.dev/ logo
What is the proper way to add an image as a test w...
# ❓|questions
i
I am trying to ask Gemini to find objects in an image, can't seem to be able to send it properly to the gemini api! prompts: - prompt.py providers: - id: google:gemini-2.0-flash-exp config: apiKey: X tests: - description: "Analyze Google " vars: image: path/promptfoo/test_images/processed/processed_google_1.png assert: - type: "contains-json" Thanks!
t
I am having a similar issue
I cannot send an image to Gemini
Im following the cURL structure and sending the image in base64
Copy code
base64_image = get_image_base64(context["vars"]["path"])
        return [{
            "contents": [
                {
                    "role": "user",
                    "parts": [
                        {"text": "Describe the image in detail"},
                        {
                            "inlineData": {
                                "mimeType": "image/jpeg",
                                "data": base64_image,
                            }
                        },
                    ],
                }
            ],
        }]
@michaelmichaelmichael or @ian do you have more info about the issue?
I have it in a prompt python script
i
Is it treating the photo the same as if it was sent as a prompt part? Because i found that sending it as a python script was making the image detection capabilities a lot weaker