fix: allow setting temperature to 0 in OpenAIModel.py (#3465)

Update OpenAIModel.py- Fix can not set temperature to 0 bug.

As when the input temperature is 0, the condition would become False , so this expressing set it to 0.1, it become impossible to set it to 0.
This commit is contained in:
MaxZhang 2024-08-22 03:12:42 +08:00 committed by GitHub
commit 5ffaa78e1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,7 @@ class OpenAIModelComponent(LCModelComponent):
model=model_name,
base_url=openai_api_base,
api_key=api_key,
temperature=temperature or 0.1,
temperature=temperature if temperature is not None else 0.1,
seed=seed,
)
if json_mode: