summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/base_provider.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-13 15:48:38 +0100
committerGitHub <noreply@github.com>2024-01-13 15:48:38 +0100
commit467f2a6fc67e6c5a6cf996da961dc1f68bd7d456 (patch)
tree70d06c98503a235d8e6727a9ea4537fea4330f8c /g4f/Provider/base_provider.py
parent~ (diff)
parentSupport upload image in gui (diff)
downloadgpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.gz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.bz2
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.lz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.xz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.zst
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.zip
Diffstat (limited to 'g4f/Provider/base_provider.py')
-rw-r--r--g4f/Provider/base_provider.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/g4f/Provider/base_provider.py b/g4f/Provider/base_provider.py
index 6da7f6c6..e7e88841 100644
--- a/g4f/Provider/base_provider.py
+++ b/g4f/Provider/base_provider.py
@@ -7,7 +7,7 @@ from concurrent.futures import ThreadPoolExecutor
from abc import abstractmethod
from inspect import signature, Parameter
from .helper import get_event_loop, get_cookies, format_prompt
-from ..typing import CreateResult, AsyncResult, Messages, Union
+from ..typing import CreateResult, AsyncResult, Messages
from ..base_provider import BaseProvider
if sys.version_info < (3, 10):
@@ -77,8 +77,7 @@ class AbstractProvider(BaseProvider):
continue
if args:
args += ", "
- args += "\n"
- args += " " + name
+ args += "\n " + name
if name != "model" and param.annotation is not Parameter.empty:
args += f": {get_type_name(param.annotation)}"
if param.default == "":
@@ -156,7 +155,7 @@ class AsyncGeneratorProvider(AsyncProvider):
messages,
stream=False,
**kwargs
- )
+ ) if not isinstance(chunk, Exception)
])
@staticmethod