Skip to content

Commit

Permalink
fix temperature=0 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin authored Mar 8, 2024
1 parent 6702bed commit 87337a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/vertexai/langchain_google_vertexai/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
6 changes: 6 additions & 0 deletions libs/vertexai/tests/unit_tests/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ def test_vertexai_args_passed() -> None:
},
},
)
assert (
model_instance.generate_content.call_args.kwargs["generation_config"][
"temperature"
]
== 0
)

0 comments on commit 87337a1

Please sign in to comment.