From 917525ee4349eb766e0035fc19c0cf5ce1fb1df1 Mon Sep 17 00:00:00 2001 From: kan-bayashi Date: Wed, 14 Feb 2024 14:49:42 +0900 Subject: [PATCH] fix args=None case --- litellm/llms/vertex_ai.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/llms/vertex_ai.py b/litellm/llms/vertex_ai.py index d42bd003f8..f7062fc6a1 100644 --- a/litellm/llms/vertex_ai.py +++ b/litellm/llms/vertex_ai.py @@ -437,8 +437,9 @@ def completion( ): function_call = response.candidates[0].content.parts[0].function_call args_dict = {} - for k, v in function_call.args.items(): - args_dict[k] = v + if function_call.args is not None: + for k, v in function_call.args.items(): + args_dict[k] = v args_str = json.dumps(args_dict) message = litellm.Message( content=None,