summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
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