summaryrefslogtreecommitdiffstats
path: root/g4f/__init__.py
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2023-10-12 15:51:11 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2023-10-12 15:51:11 +0200
commit5a64e238c805055f33dab65e855bdf1adb9fe37f (patch)
tree3c1a1b30e3ba026a0265dcbac94f360f2c74b2f8 /g4f/__init__.py
parent~ (diff)
downloadgpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar.gz
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar.bz2
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar.lz
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar.xz
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.tar.zst
gpt4free-5a64e238c805055f33dab65e855bdf1adb9fe37f.zip
Diffstat (limited to 'g4f/__init__.py')
-rw-r--r--g4f/__init__.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index 7ae81922..1a696c6c 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -48,14 +48,11 @@ def get_model_and_provider(model : Union[Model, str],
class ChatCompletion:
@staticmethod
- def create(
- model: Union[Model, str],
- messages : Messages,
- provider : Union[type[BaseProvider], None] = None,
- stream : bool = False,
- auth : Union[str, None] = None,
- **kwargs
- ) -> Union[CreateResult, str]:
+ def create(model: Union[Model, str],
+ messages : Messages,
+ provider : Union[type[BaseProvider], None] = None,
+ stream : bool = False,
+ auth : Union[str, None] = None, **kwargs) -> Union[CreateResult, str]:
model, provider = get_model_and_provider(model, provider, stream)
@@ -71,12 +68,11 @@ class ChatCompletion:
@staticmethod
async def create_async(
- model: Union[Model, str],
+ model : Union[Model, str],
messages: Messages,
provider: Union[type[BaseProvider], None] = None,
- stream: bool = False,
- **kwargs
- ) -> str:
+ stream : bool = False, **kwargs) -> str:
+
if stream:
raise ValueError(f'"create_async" does not support "stream" argument')