OpenAI Error: The input prompt cannot be handled by the engine.
INFO 2024-03-28 07:53:38,966 util 54208 6204682240 error_code=None error_message=‘The input prompt cannot be handled by the engine.’ error_param=None error_type=invalid_request_error message=‘OpenAI API error received’ stream_error=False
MY prompt is : Calm & Modern Bed Room in Coastal theme and is furnished with Rich furnitures with Conventional Ceiling and is lit up by Candle Chandeliers
I am now seeing this error frequently, sometimes it is generating sometimes it is not.
This guy seems to be on the case, as I get no error without sending a bad prompt.
from openai import OpenAI
client = OpenAI()
try:
img=client.images.generate(
model="dall-e-3",
prompt={"bad":"A computer engineer is in a datacenter in an aisle of rack\
servers, looking for the fault in a computer rack system."},
size="1024x1024",
)
print(img.data[0].revised_prompt)
print(img.data[0].url)
except Exception as e:
print(e)
In which case you get a full explanation of the problem with the input (not a string).
Error code: 400 - {'error': {'code': None, 'message': "{'bad': 'A computer engineer is in a datacenter in an aisle of rack servers, looking for the fault in a comuputer rack system.'} is not of type 'string' - 'prompt'", 'param': None, 'type': 'invalid_request_error'}}