From 463b1aff24665e2235045c4aca32615f6dc51472 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 27 Apr 2024 11:43:00 -0700 Subject: [PATCH] fix(vertex_ai.py): support safety settings for async streaming calls --- litellm/llms/vertex_ai.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/llms/vertex_ai.py b/litellm/llms/vertex_ai.py index e8e9ca5827c..f107af38be3 100644 --- a/litellm/llms/vertex_ai.py +++ b/litellm/llms/vertex_ai.py @@ -529,7 +529,7 @@ def completion( "instances": instances, "vertex_location": vertex_location, "vertex_project": vertex_project, - "safety_settings":safety_settings, + "safety_settings": safety_settings, **optional_params, } if optional_params.get("stream", False) is True: @@ -1025,6 +1025,7 @@ async def async_streaming( instances=None, vertex_project=None, vertex_location=None, + safety_settings=None, **optional_params, ): """ @@ -1051,6 +1052,7 @@ async def async_streaming( response = await llm_model._generate_content_streaming_async( contents=content, generation_config=optional_params, + safety_settings=safety_settings, tools=tools, )