diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-05-18 23:13:57 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-05-18 23:13:57 +0200 |
commit | 9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa (patch) | |
tree | 4a137ca4958a81272e37f952b9330a197038f83f /g4f/Provider/Blackbox.py | |
parent | Fix OpenaiChat provider, improve proofofwork (diff) | |
download | gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar.gz gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar.bz2 gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar.lz gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar.xz gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.tar.zst gpt4free-9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa.zip |
Diffstat (limited to 'g4f/Provider/Blackbox.py')
-rw-r--r-- | g4f/Provider/Blackbox.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/g4f/Provider/Blackbox.py b/g4f/Provider/Blackbox.py index 6e43a7a4..6e1e3949 100644 --- a/g4f/Provider/Blackbox.py +++ b/g4f/Provider/Blackbox.py @@ -4,7 +4,8 @@ import uuid import secrets from aiohttp import ClientSession -from ..typing import AsyncResult, Messages +from ..typing import AsyncResult, Messages, ImageType +from ..image import to_data_uri from .base_provider import AsyncGeneratorProvider class Blackbox(AsyncGeneratorProvider): @@ -17,8 +18,15 @@ class Blackbox(AsyncGeneratorProvider): model: str, messages: Messages, proxy: str = None, + image: ImageType = None, + image_name: str = None, **kwargs ) -> AsyncResult: + if image is not None: + messages[-1]["data"] = { + "fileText": image_name, + "imageBase64": to_data_uri(image) + } headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36", "Accept": "*/*", |