(fix) use cloudflare optional params

This commit is contained in:
ishaan-jaff 2023-12-30 12:00:14 +05:30
parent c33c1d85bb
commit 535a547b66

View file

@ -3419,14 +3419,13 @@ def get_optional_params(
optional_params["n"] = n
if stop is not None:
optional_params["stop_sequences"] = stop
elif (
custom_llm_provider == "cloudlfare"
): # https://developers.cloudflare.com/workers-ai/models/text-generation/#input
elif custom_llm_provider == "cloudflare":
# https://developers.cloudflare.com/workers-ai/models/text-generation/#input
supported_params = ["max_tokens", "stream"]
_check_valid_arg(supported_params=supported_params)
if max_tokens is not None:
optional_params["max_tokens"] = temperature
optional_params["max_tokens"] = max_tokens
if stream is not None:
optional_params["stream"] = stream
elif custom_llm_provider == "ollama":