fix(vertex_ai.py): fix faulty async completion function call tool check

This commit is contained in:
Krrish Dholakia 2024-04-17 16:30:28 -07:00
parent 32d94feddd
commit c47b39c032

View file

@ -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 = {}