summaryrefslogtreecommitdiffstats
path: root/g4f/__init__.py
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-09-17 23:24:04 +0200
committerGitHub <noreply@github.com>2023-09-17 23:24:04 +0200
commita1d000ea3b3625702c385d69557c3d9f80712237 (patch)
tree90b6ab77ab6c4c53eb2ac1688178638e22be90d7 /g4f/__init__.py
parent~ | Merge pull request #907 from MIDORIBIN/fix-type-hint (diff)
parentRevert "Fix type hint" (diff)
downloadgpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar.gz
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar.bz2
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar.lz
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar.xz
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.tar.zst
gpt4free-a1d000ea3b3625702c385d69557c3d9f80712237.zip
Diffstat (limited to 'g4f/__init__.py')
-rw-r--r--g4f/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index 1e8664c1..90b05c85 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -6,7 +6,6 @@ import random
logging = False
-
class ChatCompletion:
@staticmethod
def create(
@@ -22,8 +21,9 @@ class ChatCompletion:
except KeyError:
raise Exception(f'The model: {model} does not exist')
+
if not provider:
- if isinstance(model.best_provider, list):
+ if isinstance(model.best_provider, tuple):
provider = random.choice(model.best_provider)
else:
provider = model.best_provider