From 65bcc8ae8bfc435b302be7cad0f4f87961154646 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Wed, 10 Apr 2024 14:23:30 +0200 Subject: Some small fixes --- g4f/providers/base_provider.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'g4f/providers') 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)" -- cgit v1.2.3