image generation endpoint `response_format` does not match OpenAI spec
LocalAI version: LocalAI version: v2.15.0 (f69de3be0d274a676f1d1cd302dc4699f1b5aaf0)
Environment, CPU architecture, OS, and Version:
root@23ec4a478b09:/build# uname -a
Linux 23ec4a478b09 6.6.22-linuxkit #1 SMP Fri Mar 29 12:21:27 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Describe the bug
LocalAI does not accept a string for response_format when calling image generation. As per OpenAI's spec, this is a string that is either url or b64_json.
To Reproduce
$ curl http://localhost:8080/v1/images/generations -H "Content-Type: application/json" -d '{ "prompt": "|", "step": 25, "size": "512x512", "response_format": "b64_json" }'
{"error":{"code":500,"message":"failed reading parameters from request:failed parsing request body: json: cannot unmarshal string into Go struct field OpenAIRequest.response_format of type schema.ChatCompletionResponseFormat","type":""}}
Expected behavior
LocalAI accepts response_format as a string per OpenAI specs.
Logs
Additional context
I can confirm this, it is currently not supported but looking for implementation
Implementation https://github.com/mudler/LocalAI/pull/2347
fixed now in master, thanks @prajwalnayak7 !