-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.5, 5.0.1, 5.1
-
MOODLE_405_STABLE, MOODLE_500_STABLE, MOODLE_501_STABLE
Some OpenAI models (dall-e ones, mainly) historically have allowed, via the response_format param to decide if the resulting image should be provided via URL or base64 encoded in the response.
It seems that Moodle's OpenAI generate_image action only supports the former (url) and is missing any implementation for the later (b64_json).
Newer models (Gemini imagen-3.x, OpenAI gpt-image-1, ...) are ceasing support for the "url" value and only implementing the "b64_json" one. More yet, they are dropping support for response_format completely and always provide the response in b64.
Also, note that the "url" alternative has some privacy concerns as far as the resulting images are stored into public temporal storage. In the other side, the b64 format doesn't present those concerns.
So, this issue is about to add support to the b64_json format, which handling is really simple (just read the data/b64_json element in the response, base64-decode it and that's the file).
Also, as commented in MDL-83147, at some point we should make Moodle aware about the differences between different models, because they are introducing more incompatibilities between them (same provider). Right now, some parameters are being assumed (dall-e-3 ones, mainly) and they don't work with other models (both of the same OpenAI provider but also of other providers with an OpenAI compatible layer).
Ciao
PS: While this is a new feature, it really impacts Moodle 4.5 and 5.0 (unable to use those new models), so surely it should be considered to be backported. For me it looks like it's a well-isolated, aka, safe feature to backport. Over the paper at very least, it is, for me.