summaryrefslogtreecommitdiffstats
path: root/g4f/providers
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-10 14:23:30 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-10 14:23:30 +0200
commit65bcc8ae8bfc435b302be7cad0f4f87961154646 (patch)
tree0f65dde345aa2b6d0d87b5caf78169b6357761e1 /g4f/providers
parentAdd OpenRouter and DeepInfraImage Provider (#1814) (diff)
downloadgpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.gz
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.bz2
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.lz
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.xz
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.zst
gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.zip
Diffstat (limited to 'g4f/providers')
-rw-r--r--g4f/providers/base_provider.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/providers/base_provider.py b/g4f/providers/base_provider.py
index f3483fc2..86789ec2 100644
--- a/g4f/providers/base_provider.py
+++ b/g4f/providers/base_provider.py
@@ -78,6 +78,7 @@ class AbstractProvider(BaseProvider):
timeout=kwargs.get("timeout")
)
+ @classmethod
def get_parameters(cls) -> dict:
return signature(
cls.create_async_generator if issubclass(cls, AsyncGeneratorProvider) else
@@ -107,7 +108,9 @@ class AbstractProvider(BaseProvider):
continue
args += f"\n {name}"
args += f": {get_type_name(param.annotation)}" if param.annotation is not Parameter.empty else ""
- args += f' = "{param.default}"' if param.default == "" else f" = {param.default}" if param.default is not Parameter.empty else ""
+ default_value = f'"{param.default}"' if isinstance(param.default, str) else param.default
+ args += f" = {default_value}" if param.default is not Parameter.empty else ""
+ args += ","
return f"g4f.Provider.{cls.__name__} supports: ({args}\n)"