From b1dafc0ef79bdd94f69c783877217d8a5524d460 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 18 May 2024 07:37:37 +0200 Subject: Improve Liabots provider, Add image api support --- g4f/image.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'g4f/image.py') diff --git a/g4f/image.py b/g4f/image.py index 270b59ad..3d339266 100644 --- a/g4f/image.py +++ b/g4f/image.py @@ -275,6 +275,18 @@ class ImagePreview(ImageResponse): def to_string(self): return super().__str__() +class ImageDataResponse(): + def __init__( + self, + images: Union[str, list], + alt: str, + ): + self.images = images + self.alt = alt + + def get_list(self) -> list[str]: + return [self.images] if isinstance(self.images, str) else self.images + class ImageRequest: def __init__( self, -- cgit v1.2.3