Skip to content

Commit

Permalink
Update haystack/components/generators/openai_dalle.py
Browse files Browse the repository at this point in the history
Co-authored-by: Amna Mubashar <[email protected]>
  • Loading branch information
sjrl and Amnah199 authored Nov 13, 2024
1 parent 8a02d3e commit ec51ea4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions haystack/components/generators/openai_dalle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit ec51ea4

Please sign in to comment.