Allow image_generation.size to be null for OpenAI and default it to that
The API spec for image creation and image editing says "string or null", so we're allowing `null` now to trigger automatic selection.
This commit is contained in:
@@ -224,9 +224,11 @@ impl TryInto<OpenAIImageGenerationConfig> for ImageGenerationConfig {
|
||||
|
||||
fn try_into(self) -> Result<OpenAIImageGenerationConfig, Self::Error> {
|
||||
let size = if let Some(size) = &self.size {
|
||||
convert_string_to_enum::<async_openai::types::ImageSize>(size)?
|
||||
Some(convert_string_to_enum::<async_openai::types::ImageSize>(
|
||||
size,
|
||||
)?)
|
||||
} else {
|
||||
async_openai::types::ImageSize::S1024x1024
|
||||
None
|
||||
};
|
||||
|
||||
let style = if let Some(style) = &self.style {
|
||||
|
||||
Reference in New Issue
Block a user