From c47b39c032de7eb7183a0e29054e07896c60309c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 17 Apr 2024 16:30:28 -0700 Subject: [PATCH] fix(vertex_ai.py): fix faulty async completion function call tool check --- litellm/llms/vertex_ai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/vertex_ai.py b/litellm/llms/vertex_ai.py index 1d9da108b..fc2d882af 100644 --- a/litellm/llms/vertex_ai.py +++ b/litellm/llms/vertex_ai.py @@ -876,8 +876,8 @@ async def async_completion( tools=tools, ) - if tools is not None and hasattr( - response.candidates[0].content.parts[0], "function_call" + if tools is not None and bool( + getattr(response.candidates[0].content.parts[0], "function_call", None) ): function_call = response.candidates[0].content.parts[0].function_call args_dict = {}