summaryrefslogtreecommitdiffstats
path: root/g4f/__init__.py
diff options
context:
space:
mode:
authorMIDORIBIN <aquarion123@gmail.com>2023-09-16 03:33:03 +0200
committerMIDORIBIN <aquarion123@gmail.com>2023-09-16 03:33:03 +0200
commit51cfcde2b332836e6d3d3eea4b525352b43d5445 (patch)
tree671d418f90c4d35a2e466f132c94e21509e6272a /g4f/__init__.py
parent~ (diff)
downloadgpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar.gz
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar.bz2
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar.lz
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar.xz
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.tar.zst
gpt4free-51cfcde2b332836e6d3d3eea4b525352b43d5445.zip
Diffstat (limited to '')
-rw-r--r--g4f/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index 90b05c85..1e8664c1 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -6,6 +6,7 @@ import random
logging = False
+
class ChatCompletion:
@staticmethod
def create(
@@ -21,9 +22,8 @@ class ChatCompletion:
except KeyError:
raise Exception(f'The model: {model} does not exist')
-
if not provider:
- if isinstance(model.best_provider, tuple):
+ if isinstance(model.best_provider, list):
provider = random.choice(model.best_provider)
else:
provider = model.best_provider