summaryrefslogtreecommitdiffstats
path: root/g4f/providers
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-10 15:55:01 +0200
committerGitHub <noreply@github.com>2024-04-10 15:55:01 +0200
commit48a4f1308119b565a86806a3ce270b25e96a0264 (patch)
treeabbeb618fca668a60d81cb58d1aeeb8701b30754 /g4f/providers
parentAdd OpenRouter and DeepInfraImage Provider (#1814) (diff)
parentIncrease conversation title lenght (diff)
downloadgpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar.gz
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar.bz2
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar.lz
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar.xz
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.tar.zst
gpt4free-48a4f1308119b565a86806a3ce270b25e96a0264.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)"