From 9ddac1715f7d656ebcf0bc4d0247e9bfd32626fa Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 18 May 2024 23:13:57 +0200 Subject: Add get/set cookies dir, hide prompt option in gui --- g4f/Provider/Blackbox.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/Blackbox.py') 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": "*/*", -- cgit v1.2.3