From ec51ea441084927800abc4d935f69aefa3ee77d0 Mon Sep 17 00:00:00 2001 From: Sebastian Husch Lee Date: Wed, 13 Nov 2024 13:39:39 +0100 Subject: [PATCH] Update haystack/components/generators/openai_dalle.py Co-authored-by: Amna Mubashar --- haystack/components/generators/openai_dalle.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/haystack/components/generators/openai_dalle.py b/haystack/components/generators/openai_dalle.py index 03b75417ac..77baf16f5b 100644 --- a/haystack/components/generators/openai_dalle.py +++ b/haystack/components/generators/openai_dalle.py @@ -123,11 +123,7 @@ def run( model=self.model, prompt=prompt, size=size, quality=quality, response_format=response_format, n=1 ) image: Image = response.data[0] - image_str = "" - if image.url is not None: - image_str = image.url - elif image.b64_json is not None: - image_str = image.b64_json + image_str = image.url or image.b64_json or "" return {"images": [image_str], "revised_prompt": image.revised_prompt or ""} def to_dict(self) -> Dict[str, Any]: