diff --git a/libs/vertexai/langchain_google_vertexai/llms.py b/libs/vertexai/langchain_google_vertexai/llms.py index ca16de4a..7221c96b 100644 --- a/libs/vertexai/langchain_google_vertexai/llms.py +++ b/libs/vertexai/langchain_google_vertexai/llms.py @@ -215,7 +215,7 @@ def _default_params(self) -> Dict[str, Any]: updated_params = {} for param_name, param_value in params.items(): default_value = default_params.get(param_name) - if param_value or default_value: + if param_value is not None or default_value is not None: updated_params[param_name] = ( param_value if param_value is not None else default_value ) diff --git a/libs/vertexai/tests/unit_tests/test_llm.py b/libs/vertexai/tests/unit_tests/test_llm.py index 8d65221e..5fc23d7e 100644 --- a/libs/vertexai/tests/unit_tests/test_llm.py +++ b/libs/vertexai/tests/unit_tests/test_llm.py @@ -47,3 +47,9 @@ def test_vertexai_args_passed() -> None: }, }, ) + assert ( + model_instance.generate_content.call_args.kwargs["generation_config"][ + "temperature" + ] + == 0 + )