From 1122a403745dd4a026cb34c6dd26f31b96e811b5 Mon Sep 17 00:00:00 2001 From: lucca Date: Thu, 6 Jun 2024 11:09:35 -0300 Subject: [PATCH 1/2] fix function calling --- 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 bbedb011423..8fbd0ad0761 100644 --- a/litellm/llms/vertex_ai.py +++ b/litellm/llms/vertex_ai.py @@ -642,9 +642,9 @@ def completion( prompt = " ".join( [ - message["content"] + message.get("content", "") for message in messages - if isinstance(message["content"], str) + if isinstance(message.get("content", ""), str) ] ) From 5e259795962f9bc964f6988e06e532a47a83da88 Mon Sep 17 00:00:00 2001 From: lucca Date: Thu, 6 Jun 2024 11:15:56 -0300 Subject: [PATCH 2/2] improve --- 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 8fbd0ad0761..08e934ae9ee 100644 --- a/litellm/llms/vertex_ai.py +++ b/litellm/llms/vertex_ai.py @@ -642,9 +642,9 @@ def completion( prompt = " ".join( [ - message.get("content", "") + message.get("content") for message in messages - if isinstance(message.get("content", ""), str) + if isinstance(message.get("content", None), str) ] )