summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-23 11:36:57 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-23 11:36:57 +0100
commit58071796051003282ac2a387a65504320aea4564 (patch)
tree074c83e6636482def7d1636c5077d20e327857cb /g4f
parentAdd GeminiPro API provider (diff)
downloadgpt4free-58071796051003282ac2a387a65504320aea4564.tar
gpt4free-58071796051003282ac2a387a65504320aea4564.tar.gz
gpt4free-58071796051003282ac2a387a65504320aea4564.tar.bz2
gpt4free-58071796051003282ac2a387a65504320aea4564.tar.lz
gpt4free-58071796051003282ac2a387a65504320aea4564.tar.xz
gpt4free-58071796051003282ac2a387a65504320aea4564.tar.zst
gpt4free-58071796051003282ac2a387a65504320aea4564.zip
Diffstat (limited to 'g4f')
-rw-r--r--g4f/client.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/g4f/client.py b/g4f/client.py
index bf2179aa..3e11fac1 100644
--- a/g4f/client.py
+++ b/g4f/client.py
@@ -127,10 +127,6 @@ class Completions():
api_key: str = None,
**kwargs
) -> Union[ChatCompletion, Generator[ChatCompletionChunk]]:
- if max_tokens is not None:
- kwargs["max_tokens"] = max_tokens
- if stop:
- kwargs["stop"] = stop
model, provider = get_model_and_provider(
model,
self.provider if provider is None else provider,
@@ -141,6 +137,7 @@ class Completions():
response = provider.create_completion(
model, messages, stream,
proxy=self.client.get_proxy(),
+ max_tokens=max_tokens,
stop=stop,
api_key=self.client.api_key if api_key is None else api_key,
**kwargs