diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-09-23 17:32:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 17:32:21 +0200 |
commit | eaa8f712abd6d2ae181cf3f1524239658d7da5a3 (patch) | |
tree | 107121cfa813bcdb1d5f0d86216ef74561306b9a /g4f/__init__.py | |
parent | ~ | improve Vercel & g4f.Completion.create (diff) | |
parent | TypeError: issubclass() arg 1 must be a class (diff) | |
download | gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar.gz gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar.bz2 gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar.lz gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar.xz gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.tar.zst gpt4free-eaa8f712abd6d2ae181cf3f1524239658d7da5a3.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/__init__.py | 3 |
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) |