openai-api
openai-api copied to clipboard
Add additional fields (revised_prompt, b64_json) to image response
Ref:
- https://platform.openai.com/docs/api-reference/images/object
- https://github.com/openai/openai-openapi/blob/440c1718f0ea39d32d3735018cbcd6785a93db79/openapi.yaml#L10199-L10208
As per the OpenAI spec, these fields are always non-optional and always returned as a potentially-empty string.
In practice, other providers (like LocalAI) only return a b64_json field if response_format = b64_json. There's neither a url field, nor a revised_prompt.
For maximum compatibility, url was also made an Option<String>.