nociza / Bimg

A reverse-engineered Bing Image Creator API as an NPM package
The Unlicense
79 stars 11 forks source link

TypeError: imagesResponse.data.match is not a function #1

Closed fenchai23 closed 1 year ago

fenchai23 commented 1 year ago

this is while using generateImagesLinks(), I noticed it happens when my prompt is larger than a few characters.

with more testing it seems its random, no matter the prompt size. now I really have no idea what is going on.

nociza commented 1 year ago

Hi, can you give some examples of prompts that induce this behavior? I'm trying to reproduce the bug

fenchai23 commented 1 year ago

Hi, can you give some examples of prompts that induce this behavior? I'm trying to reproduce the bug

ok I think I might know why it produces this error.

I tested just now:

I think theres some kind of safety system that blocks any kind of controversial or sensitive prompts like (presidents, countries, flags, homosexuality, etc)

nociza commented 1 year ago

You're right, the error is from Bing rejecting the prompt due to content violation. I don't think there's a way to by-pass that right now, but I added some better error handling to throw a more useful error when this happens.