Skip to content

Conversation

spantaleev
Copy link

Ref:

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>.

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>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant