summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-09-23 17:10:25 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-09-23 17:10:25 +0200
commitfd5c33efb8ade99df4b360938ffc7c7b08d1582f (patch)
tree107121cfa813bcdb1d5f0d86216ef74561306b9a /g4f
parentFix: Aivvm: KeyError: '' (diff)
downloadgpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar.gz
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar.bz2
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar.lz
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar.xz
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.tar.zst
gpt4free-fd5c33efb8ade99df4b360938ffc7c7b08d1582f.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index c0f70d8a..d6388fb5 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -64,7 +64,8 @@ class ChatCompletion:
model, provider = get_model_and_provider(model, provider, False)
- if not issubclass(provider, AsyncProvider) and not issubclass(type(provider), AsyncProvider):
+ provider_type = provider if isinstance(provider, type) else type(provider)
+ if not issubclass(provider_type, AsyncProvider):
raise Exception(f"Provider: {provider.__name__} doesn't support create_async")
return await provider.create_async(model.name, messages, **kwargs)