Open AI Image Analysis format help vision ai

Hello everyone,

I am trying to use the open ai Analyse Images module but my images are in a bundle which is not the right format.

The required format is: [{ "imageUploadType": "imageUrl", "imageUrl": "https://your.image/url" }] but I have :

[
    {
        "id": "1234",
 
        "ImageLinks": [
            {
                "downloadLink": "https://api.apify.com/v2/key-value-stores/O3wdipnzbD15ICBdW/records/slideshow-image-cararh10-20240809020027-7400953718239235329-8e6e3bfe0f4b44e09b8f3440d293fc86"
            },
            {
                "downloadLink": "https://api.apify.com/v2/key-value-stores/O3wdipnzbD15ICBdW/records/slideshow-image-cararh10-20240809020027-7400953718239235329-2c82bbc1b7e34bb39c112bd05418fd44"
            },
            {
                "downloadLink": "https://api.apify.com/v2/key-value-stores/O3wdipnzbD15ICBdW/records/slideshow-image-cararh10-20240809020027-7400953718239235329-9ecb1bfca5d5472e9a4471cbba3f7ea7"
            
    }
]


Please what modules can I use to convert this to the format that works with the open AI module.

Any help would be appreciated thank you.

(Gently tagging people who have been very helpful before :raised_hands: @Msquare_Automation @Mr.Make )

Hello @hb,

With Map enabled on the Images field in your OpenAI module, add an Array Aggregator module just before OpenAI and the Array Aggregator module should have an option to select the data structure from OpenAI.
Before the Array Aggregator, add an Iterator so you can Iterate on ImageLinks.
Then, you can map the output of Array Aggregator as input to OpenAI.

I hope that makes sense and hope it works - I’m not able to test at the moment.

Oh my word thank you there is absolutely no way I would’ve figured out how to do this on my own :weary: It worked!

2 Likes