In the image generation document given by openai, I saw that the response_format parameter can generate the format of b64_json or url when controlling the production of images, but there seems to be no difference when I try it. Am I using the wrong one?
Official website said that prompt has a maximum of 1000 characters. Is there any interface or way to convert it? For example, how many characters are Chinese characters equal to, and one sentence in Chinese is multiple characters?
The schema seems to have the option in the response_format definition:
"ImageGenerationOptions": {
"type": "object",
"description": "Represents the request data used to generate images.",
"properties": {
"prompt": {
"type": "string",
"description": "A description of the desired images."
},
"n": {
"type": "integer",
"format": "int32",
"description": "The number of images to generate (defaults to 1).",
"default": 1
},
"size": {
"$ref": "#/definitions/ImageSize",
"description": "The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 (defaults to 1024x1024).",
"default": "1024x1024"
},
"response_format": {
"$ref": "#/definitions/ImageGenerationResponseFormat",
"description": " The format in which image generation response items should be presented.\n Azure OpenAI only supports URL response items.",
"x-ms-client-name": "responseFormat"
},
"user": {
"type": "string",
"description": "A unique identifier representing your end-user, which can help to monitor and detect abuse."
}
},
"required": [
"prompt"
]
},
"ImageGenerationResponseFormat": {
"type": "string",
"description": "The format in which the generated images are returned.",
"enum": [
"url",
"b64_json"
],
"x-ms-enum": {
"name": "ImageGenerationResponseFormat",
"modelAsString": true,
"values": [
{
"name": "Url",
"value": "url",
"description": "Image generation response items should provide a URL from which the image may be retrieved."
},
{
"name": "Base64",
"value": "b64_json",
"description": "Image generation response items should provide image data as a base64-encoded string."
}
]
}
},
Chinese characters may be counted as two bytes (or more). You can just send and see when your request is rejected.