summaryrefslogtreecommitdiffstats
path: root/g4f/client/__init__.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-11-20 02:42:15 +0100
committerGitHub <noreply@github.com>2024-11-20 02:42:15 +0100
commit419264f9665ed50ac0dcbf86327da8bf221ac3e8 (patch)
tree027ebe8efcb413b648101ac6fd4fe744803e8a8a /g4f/client/__init__.py
parentMerge pull request #2387 from hlohaus/info (diff)
parentFix missing provider_handler in client (diff)
downloadgpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar.gz
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar.bz2
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar.lz
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar.xz
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.tar.zst
gpt4free-419264f9665ed50ac0dcbf86327da8bf221ac3e8.zip
Diffstat (limited to 'g4f/client/__init__.py')
-rw-r--r--g4f/client/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/g4f/client/__init__.py b/g4f/client/__init__.py
index 1f3cdab1..549a244b 100644
--- a/g4f/client/__init__.py
+++ b/g4f/client/__init__.py
@@ -12,7 +12,7 @@ from typing import Union, AsyncIterator, Iterator, Coroutine
from ..providers.base_provider import AsyncGeneratorProvider
from ..image import ImageResponse, to_image, to_data_uri, is_accepted_format, EXTENSIONS_MAP
-from ..typing import Messages, Cookies, Image
+from ..typing import Messages, Image
from ..providers.types import ProviderType, FinishReason, BaseConversation
from ..errors import NoImageResponseError
from ..providers.retry_provider import IterListProvider
@@ -254,6 +254,8 @@ class Images:
provider_handler = self.models.get(model, provider or self.provider or BingCreateImages)
elif isinstance(provider, str):
provider_handler = convert_to_provider(provider)
+ else:
+ provider_handler = provider
if provider_handler is None:
raise ValueError(f"Unknown model: {model}")
if proxy is None: