summaryrefslogtreecommitdiffstats
path: root/g4f/image.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-18 08:12:17 +0200
committerGitHub <noreply@github.com>2024-05-18 08:12:17 +0200
commit4c3472f5417281ecf902edaec390bb1f7bafd808 (patch)
tree7851c85bafa452d0fa9cce74aa7b383aa704f101 /g4f/image.py
parentMerge pull request #1969 from hlohaus/leech (diff)
parentImprove Liabots provider, Add image api support (diff)
downloadgpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar.gz
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar.bz2
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar.lz
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar.xz
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.tar.zst
gpt4free-4c3472f5417281ecf902edaec390bb1f7bafd808.zip
Diffstat (limited to '')
-rw-r--r--g4f/image.py12
1 files changed, 12 insertions, 0 deletions
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,